home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_libgtop.idb / usr / freeware / src / libgtop / patches.z / patches
Encoding:
Text File  |  1999-07-16  |  235.4 KB  |  7,059 lines

  1. --- ./po/cat-id-tbl.c    Mon Mar  1 16:58:20 1999
  2. +++ ../libgtop-1.0.1/./po/cat-id-tbl.c    Wed May  5 13:36:18 1999
  3. @@ -77,29 +77,18 @@
  4.    {"\
  5.  Kernel flags of the process.\n\
  6.  \n\
  7. -On Linux, currently every flag has the math bit set, because crt0.s checks \
  8. -for math emulation, so this is not included in the output.\n\
  9. +On Linux, currently every flag has the math bit set, because crt0.s checks for math emulation, so this is not included in the output.\n\
  10.  \n\
  11.  This is probably a bug, as not every process is a compiled C program.\n\
  12.  \n\
  13.  The math bit should be a decimal 4, and the traced bit is decimal 10.", 68},
  14. -  {"\
  15. -The number of minor faults the process has made, those which have not \
  16. -required loading a memory page from disk.", 69},
  17. -  {"\
  18. -The number of major faults the process has made, those which have required \
  19. -loading a memory page from disk.", 70},
  20. +  {"The number of minor faults the process has made, those which have not required loading a memory page from disk.", 69},
  21. +  {"The number of major faults the process has made, those which have required loading a memory page from disk.", 70},
  22.    {"The number of minor faults that the process and its children have made.", 71},
  23.    {"The number of major faults that the process and its children have made.", 72},
  24. -  {"\
  25. -The current value of esp (32-bit stack pointer), as found in the kernel \
  26. -stack page for the process.", 73},
  27. +  {"The current value of esp (32-bit stack pointer), as found in the kernel stack page for the process.", 73},
  28.    {"The current EIP (32-bit instruction pointer).", 74},
  29. -  {"\
  30. -This is the \"channel\" in which the process is waiting.  This is the \
  31. -address of a system call, and can be looked up in a namelist if you need a \
  32. -textual name.  (If you have an up-to-date /etc/psdatabase, then try ps -l to \
  33. -see the WCHAN field in action)", 75},
  34. +  {"This is the \"channel\" in which the process is waiting.  This is the address of a system call, and can be looked up in a namelist if you need a textual name.  (If you have an up-to-date /etc/psdatabase, then try ps -l to see the WCHAN field in action)", 75},
  35.    {"This is the textual name of the `nwchan' field.", 76},
  36.    {"Size", 77},
  37.    {"Virtual", 78},
  38. @@ -111,13 +100,8 @@
  39.    {"Number of pages of virtual memory", 84},
  40.    {"Number of residnet set (non-swapped) pages", 85},
  41.    {"Number of pages of shared (mmap'd) memory", 86},
  42. -  {"\
  43. -Number of pages the process has in real memory, minus 3 for administrative \
  44. -purposes. This is just the pages which count towards text, data, or stack \
  45. -space. This does not include pages which have not been demand-loaded in, or \
  46. -which are swapped out.", 87},
  47. -  {"\
  48. -Current limit in bytes on the rss of the process (usually 2,147,483,647).", 88},
  49. +  {"Number of pages the process has in real memory, minus 3 for administrative purposes. This is just the pages which count towards text, data, or stack space. This does not include pages which have not been demand-loaded in, or which are swapped out.", 87},
  50. +  {"Current limit in bytes on the rss of the process (usually 2,147,483,647).", 88},
  51.    {"Text_RSS", 89},
  52.    {"ShLib_RSS", 90},
  53.    {"Data_RSS", 91},
  54. @@ -168,9 +152,7 @@
  55.    {"cumulative utime of process and reaped children", 136},
  56.    {"cumulative stime of process and reaped children", 137},
  57.    {"The time (in jiffies) of the process's next timeout", 138},
  58. -  {"\
  59. -The time (in jiffies) before the next SIGALRM is sent to the process due to \
  60. -an interval timer.", 139},
  61. +  {"The time (in jiffies) before the next SIGALRM is sent to the process due to an interval timer.", 139},
  62.    {"Tick frequency", 140},
  63.    {"SMP user-mode CPU time accumulated by process", 141},
  64.    {"SMP kernel-mode CPU time accumulated by process", 142},
  65. --- ./po/libgtop.pot    Mon Mar  1 16:58:19 1999
  66. +++ ../libgtop-1.0.1/./po/libgtop.pot    Wed May  5 13:33:13 1999
  67. @@ -1,18 +1,12 @@
  68. -# SOME DESCRIPTIVE TITLE.
  69. -# Copyright (C) YEAR Free Software Foundation, Inc.
  70. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
  71. -#
  72. -#, fuzzy
  73.  msgid ""
  74.  msgstr ""
  75. -"Project-Id-Version: PACKAGE VERSION\n"
  76. -"POT-Creation-Date: 1999-03-01 22:58+0100\n"
  77. -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  78. -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  79. -"Language-Team: LANGUAGE <LL@li.org>\n"
  80. -"MIME-Version: 1.0\n"
  81. -"Content-Type: text/plain; charset=CHARSET\n"
  82. -"Content-Transfer-Encoding: ENCODING\n"
  83. +"Date: 1999-05-05 13:33:12-0400\n"
  84. +"From: David Kaelbling,DER-200,,508-520-7826 <drk@orchietta>\n"
  85. +"Content-Type: text/plain; charset=\n"
  86. +"Xgettext-Options: --default-domain=libgtop --directory=.. --add-comments --keyword=_ --keyword=N_ --files-from=./POTFILES.in\n"
  87. +"Files: sysdeps/names/cpu.c sysdeps/names/fsusage.c sysdeps/names/loadavg.c sysdeps/names/mem.c sysdeps/names/mountlist.c sysdeps/names/msg_limits.c sysdeps/names/prockernel.c sysdeps/names/proclist.c sysdeps/names/procmap.c sysdeps/names/procmem.c sysdeps/names/procsegment.c sysdeps/names/procsignal.c sysdeps/names/procstate.c sysdeps/names/proctime.c sysdeps/names/procuid.c sysdeps/names/sem_limits.c sysdeps/names/shm_limits.c sysdeps/names/swap.c sysdeps/names/sysdeps.c sysdeps/names/uptime.c support/easy-vsnprintf.c support/error.c support/error.h support/getopt.c lib/close.c lib/command.c lib/init.c lib/open.c lib/parameter.c lib/read.c lib/read_data.c lib/sysdeps.c lib/write.c include/glibtop/close.h include/glibtop/command.h include/glibtop/cpu.h include/glibtop/error.h include/glibtop/fsusage.h include/glibtop/global.h include/glibtop/gnuserv.h include/glibtop/inodedb.h include/glibtop/loadavg.h include/glibtop/mem.h include/glibtop/mountlist.h include/glibtop/msg_limits.h "
  88. +"include/glibtop/open.h include/glibtop/parameter.h include/glibtop/prockernel.h include/glibtop/proclist.h include/glibtop/procmap.h include/glibtop/procmem.h include/glibtop/procsegment.h include/glibtop/procsignal.h include/glibtop/procstate.h include/glibtop/proctime.h include/glibtop/procuid.h include/glibtop/read.h include/glibtop/read_data.h include/glibtop/sem_limits.h include/glibtop/shm_limits.h include/glibtop/signal.h include/glibtop/swap.h include/glibtop/sysdeps.h include/glibtop/sysinfo.h include/glibtop/types.h include/glibtop/union.h include/glibtop/uptime.h include/glibtop/version.h include/glibtop/write.h include/glibtop/xmalloc.h src/inodedb/file_by_inode.c src/inodedb/mkinodedb.c src/daemon/gnuserv.c src/daemon/io.c src/daemon/main.c src/daemon/server.c src/daemon/slave.c src/daemon/version.c sysdeps/common/error.c sysdeps/common/fsusage.c sysdeps/common/gnuslib.c sysdeps/common/inodedb.c sysdeps/common/mountlist.c sysdeps/common/sysdeps_suid.c "
  89. +"sysdeps/common/xmalloc.c sysdeps/common/fsusage.h sysdeps/common/mountlist.h sysdeps/linux/close.c sysdeps/linux/cpu.c sysdeps/linux/loadavg.c sysdeps/linux/mem.c sysdeps/linux/msg_limits.c sysdeps/linux/open.c sysdeps/linux/prockernel.c sysdeps/linux/proclist.c sysdeps/linux/procmap.c sysdeps/linux/procmem.c sysdeps/linux/procsegment.c sysdeps/linux/procsignal.c sysdeps/linux/procstate.c sysdeps/linux/proctime.c sysdeps/linux/procuid.c sysdeps/linux/sem_limits.c sysdeps/linux/shm_limits.c sysdeps/linux/siglist.c sysdeps/linux/swap.c sysdeps/linux/sysinfo.c sysdeps/linux/uptime.c sysdeps/linux/glibtop_machine.h sysdeps/linux/glibtop_server.h\n"
  90.  
  91.  #: sysdeps/names/cpu.c:43
  92.  msgid "Total CPU Time"
  93. @@ -202,21 +196,15 @@
  94.  msgid "Memory in locked pages in kB"
  95.  msgstr ""
  96.  
  97. -#: sysdeps/names/mountlist.c:38 sysdeps/names/mountlist.c:45
  98. -#: sysdeps/names/proclist.c:38 sysdeps/names/proclist.c:45
  99. -#: sysdeps/names/procmap.c:38 sysdeps/names/procmap.c:45
  100. +#: sysdeps/names/mountlist.c:38 sysdeps/names/mountlist.c:45 sysdeps/names/proclist.c:38 sysdeps/names/proclist.c:45 sysdeps/names/procmap.c:38 sysdeps/names/procmap.c:45
  101.  msgid "Number of list elements"
  102.  msgstr ""
  103.  
  104. -#: sysdeps/names/mountlist.c:39 sysdeps/names/mountlist.c:46
  105. -#: sysdeps/names/proclist.c:39 sysdeps/names/proclist.c:46
  106. -#: sysdeps/names/procmap.c:39 sysdeps/names/procmap.c:46
  107. +#: sysdeps/names/mountlist.c:39 sysdeps/names/mountlist.c:46 sysdeps/names/proclist.c:39 sysdeps/names/proclist.c:46 sysdeps/names/procmap.c:39 sysdeps/names/procmap.c:46
  108.  msgid "Total size of list"
  109.  msgstr ""
  110.  
  111. -#: sysdeps/names/mountlist.c:40 sysdeps/names/mountlist.c:47
  112. -#: sysdeps/names/proclist.c:40 sysdeps/names/proclist.c:47
  113. -#: sysdeps/names/procmap.c:40 sysdeps/names/procmap.c:47
  114. +#: sysdeps/names/mountlist.c:40 sysdeps/names/mountlist.c:47 sysdeps/names/proclist.c:40 sysdeps/names/proclist.c:47 sysdeps/names/procmap.c:40 sysdeps/names/procmap.c:47
  115.  msgid "Size of a single list element"
  116.  msgstr ""
  117.  
  118. @@ -284,13 +272,11 @@
  119.  msgid "WChan"
  120.  msgstr ""
  121.  
  122. -#. K_Flags
  123.  #: sysdeps/names/prockernel.c:50
  124.  msgid ""
  125.  "Kernel flags of the process.\n"
  126.  "\n"
  127. -"On Linux, currently every flag has the math bit set, because crt0.s checks "
  128. -"for math emulation, so this is not included in the output.\n"
  129. +"On Linux, currently every flag has the math bit set, because crt0.s checks for math emulation, so this is not included in the output.\n"
  130.  "\n"
  131.  "This is probably a bug, as not every process is a compiled C program.\n"
  132.  "\n"
  133. @@ -299,19 +285,14 @@
  134.  
  135.  #. Min_Flt
  136.  #: sysdeps/names/prockernel.c:59
  137. -msgid ""
  138. -"The number of minor faults the process has made, those which have not "
  139. -"required loading a memory page from disk."
  140. +msgid "The number of minor faults the process has made, those which have not required loading a memory page from disk."
  141.  msgstr ""
  142.  
  143.  #. Maj_Flt
  144.  #: sysdeps/names/prockernel.c:62
  145. -msgid ""
  146. -"The number of major faults the process has made, those which have required "
  147. -"loading a memory page from disk."
  148. +msgid "The number of major faults the process has made, those which have required loading a memory page from disk."
  149.  msgstr ""
  150.  
  151. -#. CMin_Flt
  152.  #: sysdeps/names/prockernel.c:65
  153.  msgid "The number of minor faults that the process and its children have made."
  154.  msgstr ""
  155. @@ -323,12 +304,9 @@
  156.  
  157.  #. KStk_ESP
  158.  #: sysdeps/names/prockernel.c:71
  159. -msgid ""
  160. -"The current value of esp (32-bit stack pointer), as found in the kernel "
  161. -"stack page for the process."
  162. +msgid "The current value of esp (32-bit stack pointer), as found in the kernel stack page for the process."
  163.  msgstr ""
  164.  
  165. -#. KStk_EIP
  166.  #: sysdeps/names/prockernel.c:74
  167.  msgid "The current EIP (32-bit instruction pointer)."
  168.  msgstr ""
  169. @@ -335,11 +313,7 @@
  170.  
  171.  #. NWChan
  172.  #: sysdeps/names/prockernel.c:76
  173. -msgid ""
  174. -"This is the \"channel\" in which the process is waiting.  This is the "
  175. -"address of a system call, and can be looked up in a namelist if you need a "
  176. -"textual name.  (If you have an up-to-date /etc/psdatabase, then try ps -l to "
  177. -"see the WCHAN field in action)"
  178. +msgid "This is the \"channel\" in which the process is waiting.  This is the address of a system call, and can be looked up in a namelist if you need a textual name.  (If you have an up-to-date /etc/psdatabase, then try ps -l to see the WCHAN field in action)"
  179.  msgstr ""
  180.  
  181.  #. WChan
  182. @@ -388,16 +362,11 @@
  183.  msgstr ""
  184.  
  185.  #: sysdeps/names/procmem.c:57
  186. -msgid ""
  187. -"Number of pages the process has in real memory, minus 3 for administrative "
  188. -"purposes. This is just the pages which count towards text, data, or stack "
  189. -"space. This does not include pages which have not been demand-loaded in, or "
  190. -"which are swapped out."
  191. +msgid "Number of pages the process has in real memory, minus 3 for administrative purposes. This is just the pages which count towards text, data, or stack space. This does not include pages which have not been demand-loaded in, or which are swapped out."
  192.  msgstr ""
  193.  
  194.  #: sysdeps/names/procmem.c:62
  195. -msgid ""
  196. -"Current limit in bytes on the rss of the process (usually 2,147,483,647)."
  197. +msgid "Current limit in bytes on the rss of the process (usually 2,147,483,647)."
  198.  msgstr ""
  199.  
  200.  #: sysdeps/names/procsegment.c:42
  201. @@ -601,9 +570,7 @@
  202.  msgstr ""
  203.  
  204.  #: sysdeps/names/proctime.c:58
  205. -msgid ""
  206. -"The time (in jiffies) before the next SIGALRM is sent to the process due to "
  207. -"an interval timer."
  208. +msgid "The time (in jiffies) before the next SIGALRM is sent to the process due to an interval timer."
  209.  msgstr ""
  210.  
  211.  #: sysdeps/names/proctime.c:60
  212. @@ -923,66 +890,54 @@
  213.  msgstr ""
  214.  
  215.  #: support/getopt.c:669
  216. -#, c-format
  217.  msgid "%s: option `%s' is ambiguous\n"
  218.  msgstr ""
  219.  
  220. +#. --option
  221.  #: support/getopt.c:693
  222. -#, c-format
  223.  msgid "%s: option `--%s' doesn't allow an argument\n"
  224.  msgstr ""
  225.  
  226.  #: support/getopt.c:698
  227. -#, c-format
  228.  msgid "%s: option `%c%s' doesn't allow an argument\n"
  229.  msgstr ""
  230.  
  231.  #: support/getopt.c:715 support/getopt.c:888
  232. -#, c-format
  233.  msgid "%s: option `%s' requires an argument\n"
  234.  msgstr ""
  235.  
  236.  #. --option
  237.  #: support/getopt.c:744
  238. -#, c-format
  239.  msgid "%s: unrecognized option `--%s'\n"
  240.  msgstr ""
  241.  
  242. -#. +option or -option
  243.  #: support/getopt.c:748
  244. -#, c-format
  245.  msgid "%s: unrecognized option `%c%s'\n"
  246.  msgstr ""
  247.  
  248.  #. 1003.2 specifies the format of this message.
  249.  #: support/getopt.c:774
  250. -#, c-format
  251.  msgid "%s: illegal option -- %c\n"
  252.  msgstr ""
  253.  
  254.  #: support/getopt.c:777
  255. -#, c-format
  256.  msgid "%s: invalid option -- %c\n"
  257.  msgstr ""
  258.  
  259.  #. 1003.2 specifies the format of this message.
  260.  #: support/getopt.c:807 support/getopt.c:937
  261. -#, c-format
  262.  msgid "%s: option requires an argument -- %c\n"
  263.  msgstr ""
  264.  
  265.  #: support/getopt.c:854
  266. -#, c-format
  267.  msgid "%s: option `-W %s' is ambiguous\n"
  268.  msgstr ""
  269.  
  270.  #: support/getopt.c:872
  271. -#, c-format
  272.  msgid "%s: option `-W %s' doesn't allow an argument\n"
  273.  msgstr ""
  274.  
  275. -#: lib/read.c:71
  276. -#, c-format
  277. +#: lib/read.c:75
  278.  msgid "read %d bytes"
  279.  msgstr ""
  280.  
  281. @@ -991,12 +946,10 @@
  282.  msgstr ""
  283.  
  284.  #: lib/read_data.c:66
  285. -#, c-format
  286.  msgid "read data %d bytes"
  287.  msgstr ""
  288.  
  289.  #: lib/write.c:48
  290. -#, c-format
  291.  msgid "write %d bytes"
  292.  msgstr ""
  293.  
  294. @@ -1033,7 +986,6 @@
  295.  msgstr ""
  296.  
  297.  #: src/daemon/gnuserv.c:485
  298. -#, c-format
  299.  msgid ""
  300.  "Error on option %s: %s.\n"
  301.  "Run '%s --help' to see a full list of available command line options.\n"
  302. --- ./lib/read.c    Tue Feb 23 06:43:36 1999
  303. +++ ../libgtop-1.0.1/./lib/read.c    Wed May  5 11:53:51 1999
  304. @@ -30,6 +30,7 @@
  305.  {
  306.      int nread;
  307.      size_t already_read = 0, remaining = total_size;
  308. +    char *tmp_ptr;
  309.      
  310.      while (already_read < total_size) {
  311.          nread = recv (s, ptr, remaining, 0);
  312. @@ -46,7 +47,10 @@
  313.          
  314.          already_read += nread;
  315.          remaining -= nread;
  316. -        (char *) ptr += nread;
  317. +        /* (char *) ptr += nread; */
  318. +        tmp_ptr = ptr;
  319. +        tmp_ptr += nread;
  320. +        ptr = tmp_ptr;
  321.      }
  322.  }
  323.  
  324. --- ./src/daemon/io.c    Tue Feb 23 06:43:42 1999
  325. +++ ../libgtop-1.0.1/./src/daemon/io.c    Wed May  5 11:53:34 1999
  326. @@ -62,6 +62,7 @@
  327.  do_read (int s, void *ptr, size_t total_size)
  328.  {
  329.      int nread;
  330. +    char *tmp_ptr;
  331.      size_t already_read = 0, remaining = total_size;
  332.  
  333.      while (already_read < total_size) {
  334. @@ -82,7 +83,10 @@
  335.  
  336.          already_read += nread;
  337.          remaining -= nread;
  338. -        (char *) ptr += nread;
  339. +        /* (char *) ptr += nread; */
  340. +        tmp_ptr = ptr;
  341. +        tmp_ptr += nread;
  342. +        ptr = tmp_ptr;
  343.  
  344.  #ifdef REAL_DEBUG
  345.          fprintf (stderr, "READ (%d): %d - %d - %d\n",
  346. --- ./ltmain.sh    Mon Mar  1 16:52:03 1999
  347. +++ ../libgtop-1.0.1/./ltmain.sh    Wed May  5 11:57:06 1999
  348. @@ -1,8 +1,8 @@
  349.  # ltmain.sh - Provide generalized library-building support services.
  350.  # NOTE: Changing this file will not affect anything until you rerun ltconfig.
  351.  #
  352. -# Copyright (C) 1996-1998 Free Software Foundation, Inc.
  353. -# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  354. +# Copyright (C) 1996-1999 Free Software Foundation, Inc.
  355. +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  356.  #
  357.  # This program is free software; you can redistribute it and/or modify
  358.  # it under the terms of the GNU General Public License as published by
  359. @@ -28,12 +28,8 @@
  360.    # Discard the --no-reexec flag, and continue.
  361.    shift
  362.  elif test "X$1" = X--fallback-echo; then
  363. -  # used as fallback echo
  364. -  shift
  365. -  cat <<EOF
  366. -$*
  367. -EOF
  368. -  exit 0
  369. +  # Avoid inline document here, it may be left over
  370. +  :
  371.  elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  372.    # Yippee, $echo works!
  373.    :
  374. @@ -42,6 +38,15 @@
  375.    exec $SHELL "$0" --no-reexec ${1+"$@"}
  376.  fi
  377.  
  378. +if test "X$1" = X--fallback-echo; then
  379. +  # used as fallback echo
  380. +  shift
  381. +  cat <<EOF
  382. +$*
  383. +EOF
  384. +  exit 0
  385. +fi
  386. +
  387.  # The name of this program.
  388.  progname=`$echo "$0" | sed 's%^.*/%%'`
  389.  modename="$progname"
  390. @@ -49,7 +54,8 @@
  391.  # Constants.
  392.  PROGRAM=ltmain.sh
  393.  PACKAGE=libtool
  394. -VERSION=1.2d
  395. +VERSION=1.3
  396. +TIMESTAMP=" (1.385.2.117 1999/04/29 13:07:13)"
  397.  
  398.  default_mode=
  399.  help="Try \`$progname --help' for more information."
  400. @@ -60,8 +66,10 @@
  401.  
  402.  # Sed substitution that helps us do robust quoting.  It backslashifies
  403.  # metacharacters that are still active within double-quoted strings.
  404. -Xsed='sed -e s/^X//'
  405. +Xsed='sed -e 1s/^X//'
  406.  sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  407. +SP2NL='tr \040 \012'
  408. +NL2SP='tr \012 \040'
  409.  
  410.  # NLS nuisances.
  411.  # Only set LANG and LC_ALL to C if already set.
  412. @@ -97,7 +105,7 @@
  413.  show_help=
  414.  execute_dlfiles=
  415.  lo2o="s/\\.lo\$/.${objext}/"
  416. -los2o="s/\\.lo /.${objext} /g"
  417. +o2lo="s/\\.${objext}\$/.lo/"
  418.  
  419.  # Parse our command line options once, thoroughly.
  420.  while test $# -gt 0
  421. @@ -133,7 +141,7 @@
  422.      ;;
  423.  
  424.    --version)
  425. -    echo "$PROGRAM (GNU $PACKAGE) $VERSION"
  426. +    echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  427.      exit 0
  428.      ;;
  429.  
  430. @@ -208,12 +216,12 @@
  431.        mode=link
  432.        for arg
  433.        do
  434. -        case "$arg" in
  435. -        -c)
  436. -           mode=compile
  437. -           break
  438. -           ;;
  439. -        esac
  440. +    case "$arg" in
  441. +    -c)
  442. +       mode=compile
  443. +       break
  444. +       ;;
  445. +    esac
  446.        done
  447.        ;;
  448.      *db | *dbx | *strace | *truss)
  449. @@ -231,11 +239,11 @@
  450.  
  451.        # Just use the default operation mode.
  452.        if test -z "$mode"; then
  453. -        if test -n "$nonopt"; then
  454. -          $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  455. -        else
  456. -          $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  457. -        fi
  458. +    if test -n "$nonopt"; then
  459. +      $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  460. +    else
  461. +      $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  462. +    fi
  463.        fi
  464.        ;;
  465.      esac
  466. @@ -262,7 +270,6 @@
  467.      lastarg=
  468.      srcfile="$nonopt"
  469.      suppress_output=
  470. -    force_static=no
  471.  
  472.      user_target=no
  473.      for arg
  474. @@ -270,36 +277,31 @@
  475.        # Accept any command-line options.
  476.        case "$arg" in
  477.        -o)
  478. -        if test "$user_target" != "no"; then
  479. -          $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  480. +    if test "$user_target" != "no"; then
  481. +      $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  482.        exit 1
  483. -        fi
  484. -        user_target=next
  485. +    fi
  486. +    user_target=next
  487.      ;;
  488.  
  489. -      -force-static)
  490. -        force_static=yes
  491. -        continue
  492. -        ;;
  493. -    
  494.        -static)
  495. -        build_old_libs=yes
  496. -        continue
  497. -        ;;
  498. +    build_old_libs=yes
  499. +    continue
  500. +    ;;
  501.        esac
  502.  
  503.        case "$user_target" in
  504.        next)
  505. -        # The next one is the -o target name
  506. -        user_target=yes
  507. -        continue
  508. -        ;;
  509. +    # The next one is the -o target name
  510. +    user_target=yes
  511. +    continue
  512. +    ;;
  513.        yes)
  514. -        # We got the output file
  515. -        user_target=set
  516. -        libobj="$arg"
  517. -        continue
  518. -        ;;
  519. +    # We got the output file
  520. +    user_target=set
  521. +    libobj="$arg"
  522. +    continue
  523. +    ;;
  524.        esac
  525.  
  526.        # Accept the current argument as the source file.
  527. @@ -318,15 +320,15 @@
  528.        # sets, so we specify it separately.
  529.        case "$lastarg" in
  530.        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
  531. -        lastarg="\"$lastarg\""
  532. -        ;;
  533. +    lastarg="\"$lastarg\""
  534. +    ;;
  535.        esac
  536.  
  537.        # Add the previous argument to base_compile.
  538.        if test -z "$base_compile"; then
  539. -        base_compile="$lastarg"
  540. +    base_compile="$lastarg"
  541.        else
  542. -        base_compile="$base_compile $lastarg"
  543. +    base_compile="$base_compile $lastarg"
  544.        fi
  545.      done
  546.  
  547. @@ -377,9 +379,9 @@
  548.  
  549.      # Delete any leftover library objects.
  550.      if test "$build_old_libs" = yes; then
  551. -      removelist="$obj $libobj $lockfile"
  552. +      removelist="$obj $libobj"
  553.      else
  554. -      removelist="$libobj $lockfile"
  555. +      removelist="$libobj"
  556.      fi
  557.  
  558.      $run $rm $removelist
  559. @@ -401,8 +403,8 @@
  560.      # We use this script file to make the link, it avoids creating a new file
  561.      if test "$need_locks" = yes; then
  562.        until ln "$0" "$lockfile" 2>/dev/null; do
  563. -        $show "Waiting for $lockfile to be removed"
  564. -        sleep 2
  565. +    $show "Waiting for $lockfile to be removed"
  566. +    sleep 2
  567.        done
  568.      elif test "$need_locks" = warn; then
  569.        if test -f "$lockfile"; then
  570. @@ -433,20 +435,42 @@
  571.        fbsd_hideous_sh_bug=$base_compile
  572.  
  573.        # All platforms use -DPIC, to notify preprocessed assembler code.
  574. -      command="$base_compile$pic_flag -DPIC $srcfile"
  575. +      command="$base_compile $pic_flag -DPIC $srcfile"
  576. +      if test "$build_old_libs" = yes; then
  577. +    lo_libobj="$libobj"
  578. +    dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
  579. +    if test "X$dir" = "X$libobj"; then
  580. +      dir="$objdir"
  581. +    else
  582. +      dir="$dir/$objdir"
  583. +    fi
  584. +    libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  585. +
  586. +    if test -d "$dir"; then
  587. +      $show "$rm $libobj"
  588. +      $run $rm $libobj
  589. +    else
  590. +      $show "$mkdir $dir"
  591. +      $run $mkdir $dir
  592. +      status=$?
  593. +      if test $status -ne 0 && test ! -d $dir; then
  594. +        exit $status
  595. +      fi
  596. +    fi
  597. +      fi
  598.        if test "$compiler_o_lo" = yes; then
  599. -        command="$command -o $libobj"
  600. -        output_obj="$libobj"
  601. +    output_obj="$libobj"
  602. +    command="$command -o $output_obj"
  603.        elif test "$compiler_c_o" = yes; then
  604. -        command="$command -o $obj"
  605. -        output_obj="$obj"
  606. +    output_obj="$obj"
  607. +    command="$command -o $output_obj"
  608.        fi
  609.  
  610.        $show "$command"
  611.        if $run eval "$command"; then :
  612.        else
  613. -        test -n "$output_obj" && $run $rm $removelist
  614. -        exit 1
  615. +    test -n "$output_obj" && $run $rm $removelist
  616. +    exit 1
  617.        fi
  618.  
  619.        if test "$need_locks" = warn &&
  620. @@ -470,9 +494,9 @@
  621.        fi
  622.  
  623.        # Just move the object if needed, then go on to compile the next one
  624. -      if test "$compiler_o_lo" = no && test x"$output_obj" != x"$libobj"; then
  625. -        $show "$mv $output_obj $libobj"
  626. -        if $run $mv $output_obj $libobj; then :
  627. +      if test x"$output_obj" != x"$libobj"; then
  628. +    $show "$mv $output_obj $libobj"
  629. +    if $run $mv $output_obj $libobj; then :
  630.      else
  631.        error=$?
  632.        $run $rm $removelist
  633. @@ -480,14 +504,28 @@
  634.      fi
  635.        fi
  636.  
  637. -      # If we have no pic_flag and do not have -force-static, 
  638. -      # then copy the object into place and finish.
  639. -      if test -z "$pic_flag" && test "$force_static" = no; then
  640. -        $show "$LN_S $libobj $obj"
  641. -        if $run $LN_S $libobj $obj; then
  642. +      # If we have no pic_flag, then copy the object into place and finish.
  643. +      if test -z "$pic_flag" && test "$build_old_libs" = yes; then
  644. +    # Rename the .lo from within objdir to obj
  645. +    if test -f $obj; then
  646. +      $show $rm $obj
  647. +      $run $rm $obj
  648. +    fi
  649. +
  650. +    $show "$mv $libobj $obj"
  651. +    if $run $mv $libobj $obj; then :
  652. +    else
  653. +      error=$?
  654. +      $run $rm $removelist
  655. +      exit $error
  656. +    fi
  657. +
  658. +    # Now arrange that obj and lo_libobj become the same file
  659. +    $show "$LN_S $obj $lo_libobj"
  660. +    if $run $LN_S $obj $lo_libobj; then
  661.        exit 0
  662.      else
  663. -          error=$?
  664. +      error=$?
  665.        $run $rm $removelist
  666.        exit $error
  667.      fi
  668. @@ -500,12 +538,9 @@
  669.      # Only build a position-dependent object if we build old libraries.
  670.      if test "$build_old_libs" = yes; then
  671.        command="$base_compile $srcfile"
  672. -      if test "$force_static" = yes; then
  673. -        command="$command -DLIBTOOL_STATIC"
  674. -      fi
  675.        if test "$compiler_c_o" = yes; then
  676. -        command="$command -o $obj"
  677. -        output_obj="$obj"
  678. +    command="$command -o $obj"
  679. +    output_obj="$obj"
  680.        fi
  681.  
  682.        # Suppress compiler output if we already did a PIC compilation.
  683. @@ -513,8 +548,8 @@
  684.        $show "$command"
  685.        if $run eval "$command"; then :
  686.        else
  687. -        $run $rm $removelist
  688. -        exit 1
  689. +    $run $rm $removelist
  690. +    exit 1
  691.        fi
  692.  
  693.        if test "$need_locks" = warn &&
  694. @@ -538,9 +573,25 @@
  695.        fi
  696.  
  697.        # Just move the object if needed
  698. -      if test "$compiler_c_o" = no && test x"$output_obj" != x"$obj"; then
  699. -        $show "$mv $output_obj $obj"
  700. -        if $run $mv $output_obj $obj; then :
  701. +      if test x"$output_obj" != x"$obj"; then
  702. +    $show "$mv $output_obj $obj"
  703. +    if $run $mv $output_obj $obj; then :
  704. +    else
  705. +      error=$?
  706. +      $run $rm $removelist
  707. +      exit $error
  708. +    fi
  709. +      fi
  710. +
  711. +      # Create an invalid libtool object if no PIC, so that we do not
  712. +      # accidentally link it into a program.
  713. +      if test "$build_libtool_libs" != yes; then
  714. +    $show "echo timestamp > $libobj"
  715. +    $run eval "echo timestamp > \$libobj" || exit $?
  716. +      else
  717. +    # Move the .lo from within objdir
  718. +    $show "$mv $libobj $lo_libobj"
  719. +    if $run $mv $libobj $lo_libobj; then :
  720.      else
  721.        error=$?
  722.        $run $rm $removelist
  723. @@ -554,13 +605,6 @@
  724.        $rm "$lockfile"
  725.      fi
  726.  
  727. -    # Create an invalid libtool object if no PIC, so that we do not
  728. -    # accidentally link it into a program.
  729. -    if test "$build_libtool_libs" != yes; then
  730. -      $show "echo timestamp > $libobj"
  731. -      $run eval "echo timestamp > \$libobj" || exit $?
  732. -    fi
  733. -
  734.      exit 0
  735.      ;;
  736.  
  737. @@ -569,34 +613,230 @@
  738.      modename="$modename: link"
  739.      C_compiler="$CC" # save it, to compile generated C sources
  740.      CC="$nonopt"
  741. -    allow_undefined=yes
  742. +    case "$host" in
  743. +    *-*-cygwin* | *-*-mingw* | *-*-os2*)
  744. +      # It is impossible to link a dll without this setting, and
  745. +      # we shouldn't force the makefile maintainer to figure out
  746. +      # which system we are compiling for in order to pass an extra
  747. +      # flag for every libtool invokation.
  748. +      # allow_undefined=no
  749. +
  750. +      # FIXME: Unfortunately, there are problems with the above when trying
  751. +      # to make a dll which has undefined symbols, in which case not
  752. +      # even a static library is built.  For now, we need to specify
  753. +      # -no-undefined on the libtool link line when we can be certain
  754. +      # that all symbols are satisfied, otherwise we get a static library.
  755. +      allow_undefined=yes
  756. +
  757. +      # This is a source program that is used to create dlls on Windows
  758. +      # Don't remove nor modify the starting and closing comments
  759. +# /* ltdll.c starts here */
  760. +# #define WIN32_LEAN_AND_MEAN
  761. +# #include <windows.h>
  762. +# #undef WIN32_LEAN_AND_MEAN
  763. +# #include <stdio.h>
  764. +#
  765. +# #ifdef __cplusplus
  766. +# extern "C" {
  767. +# #endif
  768. +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
  769. +# #ifdef __cplusplus
  770. +# }
  771. +# #endif
  772. +#
  773. +# #include <cygwin/cygwin_dll.h>
  774. +# DECLARE_CYGWIN_DLL( DllMain );
  775. +# HINSTANCE __hDllInstance_base;
  776. +#
  777. +# BOOL APIENTRY
  778. +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
  779. +# {
  780. +#   __hDllInstance_base = hInst;
  781. +#   return TRUE;
  782. +# }
  783. +# /* ltdll.c ends here */
  784. +      # This is a source program that is used to create import libraries
  785. +      # on Windows for dlls which lack them. Don't remove nor modify the
  786. +      # starting and closing comments
  787. +# /* impgen.c starts here */
  788. +# /*   Copyright (C) 1999 Free Software Foundation, Inc.
  789. +# 
  790. +#  This file is part of GNU libtool.
  791. +# 
  792. +#  This program is free software; you can redistribute it and/or modify
  793. +#  it under the terms of the GNU General Public License as published by
  794. +#  the Free Software Foundation; either version 2 of the License, or
  795. +#  (at your option) any later version.
  796. +# 
  797. +#  This program is distributed in the hope that it will be useful,
  798. +#  but WITHOUT ANY WARRANTY; without even the implied warranty of
  799. +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  800. +#  GNU General Public License for more details.
  801. +# 
  802. +#  You should have received a copy of the GNU General Public License
  803. +#  along with this program; if not, write to the Free Software
  804. +#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  805. +#  */
  806. +# 
  807. +#  #include <stdio.h>        /* for printf() */
  808. +#  #include <unistd.h>        /* for open(), lseek(), read() */
  809. +#  #include <fcntl.h>        /* for O_RDONLY, O_BINARY */
  810. +#  #include <string.h>        /* for strdup() */
  811. +# 
  812. +#  static unsigned int
  813. +#  pe_get16 (fd, offset)
  814. +#       int fd;
  815. +#       int offset;
  816. +#  {
  817. +#    unsigned char b[2];
  818. +#    lseek (fd, offset, SEEK_SET);
  819. +#    read (fd, b, 2);
  820. +#    return b[0] + (b[1]<<8);
  821. +#  }
  822. +# 
  823. +#  static unsigned int
  824. +#  pe_get32 (fd, offset)
  825. +#      int fd;
  826. +#      int offset;
  827. +#  {
  828. +#    unsigned char b[4];
  829. +#    lseek (fd, offset, SEEK_SET);
  830. +#    read (fd, b, 4);
  831. +#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  832. +#  }
  833. +# 
  834. +#  static unsigned int
  835. +#  pe_as32 (ptr)
  836. +#       void *ptr;
  837. +#  {
  838. +#    unsigned char *b = ptr;
  839. +#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  840. +#  }
  841. +# 
  842. +#  int
  843. +#  main (argc, argv)
  844. +#      int argc;
  845. +#      char *argv[];
  846. +#  {
  847. +#      int dll;
  848. +#      unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
  849. +#      unsigned long export_rva, export_size, nsections, secptr, expptr;
  850. +#      unsigned long name_rvas, nexp;
  851. +#      unsigned char *expdata, *erva;
  852. +#      char *filename, *dll_name;
  853. +# 
  854. +#      filename = argv[1];
  855. +# 
  856. +#      dll = open(filename, O_RDONLY|O_BINARY);
  857. +#      if (!dll)
  858. +#      return 1;
  859. +# 
  860. +#      dll_name = filename;
  861. +#    
  862. +#      for (i=0; filename[i]; i++)
  863. +#      if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
  864. +#          dll_name = filename + i +1;
  865. +# 
  866. +#      pe_header_offset = pe_get32 (dll, 0x3c);
  867. +#      opthdr_ofs = pe_header_offset + 4 + 20;
  868. +#      num_entries = pe_get32 (dll, opthdr_ofs + 92);
  869. +# 
  870. +#      if (num_entries < 1) /* no exports */
  871. +#      return 1;
  872. +# 
  873. +#      export_rva = pe_get32 (dll, opthdr_ofs + 96);
  874. +#      export_size = pe_get32 (dll, opthdr_ofs + 100);
  875. +#      nsections = pe_get16 (dll, pe_header_offset + 4 +2);
  876. +#      secptr = (pe_header_offset + 4 + 20 +
  877. +#            pe_get16 (dll, pe_header_offset + 4 + 16));
  878. +# 
  879. +#      expptr = 0;
  880. +#      for (i = 0; i < nsections; i++)
  881. +#      {
  882. +#      char sname[8];
  883. +#      unsigned long secptr1 = secptr + 40 * i;
  884. +#      unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
  885. +#      unsigned long vsize = pe_get32 (dll, secptr1 + 16);
  886. +#      unsigned long fptr = pe_get32 (dll, secptr1 + 20);
  887. +#      lseek(dll, secptr1, SEEK_SET);
  888. +#      read(dll, sname, 8);
  889. +#      if (vaddr <= export_rva && vaddr+vsize > export_rva)
  890. +#      {
  891. +#          expptr = fptr + (export_rva - vaddr);
  892. +#          if (export_rva + export_size > vaddr + vsize)
  893. +#          export_size = vsize - (export_rva - vaddr);
  894. +#          break;
  895. +#      }
  896. +#      }
  897. +# 
  898. +#      expdata = (unsigned char*)malloc(export_size);
  899. +#      lseek (dll, expptr, SEEK_SET);
  900. +#      read (dll, expdata, export_size);
  901. +#      erva = expdata - export_rva;
  902. +# 
  903. +#      nexp = pe_as32 (expdata+24);
  904. +#      name_rvas = pe_as32 (expdata+32);
  905. +# 
  906. +#      printf ("EXPORTS\n");
  907. +#      for (i = 0; i<nexp; i++)
  908. +#      {
  909. +#      unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
  910. +#      printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
  911. +#      }
  912. +# 
  913. +#      return 0;
  914. +#  }
  915. +# /* impgen.c ends here */
  916. +      ;;
  917. +    *)
  918. +      allow_undefined=yes
  919. +      ;;
  920. +    esac
  921.      compile_command="$CC"
  922.      finalize_command="$CC"
  923.  
  924. +    compile_rpath=
  925. +    finalize_rpath=
  926.      compile_shlibpath=
  927.      finalize_shlibpath=
  928.      convenience=
  929.      old_convenience=
  930.      deplibs=
  931. -    eval lib_search_path=\"$sys_lib_search_path\"
  932. +    linkopts=
  933. +
  934. +    if test -n "$shlibpath_var"; then
  935. +      # get the directories listed in $shlibpath_var
  936. +      eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  937. +    else
  938. +      lib_search_path=
  939. +    fi
  940. +    # now prepend the system-specific ones
  941. +    eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
  942. +    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  943.      
  944. +    avoid_version=no
  945.      dlfiles=
  946.      dlprefiles=
  947. +    dlself=no
  948.      export_dynamic=no
  949.      export_symbols=
  950. +    export_symbols_regex=
  951.      generated=
  952. -    hardcode_libdirs=
  953.      libobjs=
  954.      link_against_libtool_libs=
  955.      ltlibs=
  956.      module=no
  957.      objs=
  958. +    prefer_static_libs=no
  959. +    preload=no
  960.      prev=
  961.      prevarg=
  962.      release=
  963.      rpath=
  964. +    xrpath=
  965.      perm_rpath=
  966.      temp_rpath=
  967. +    thread_safe=no
  968.      vinfo=
  969.  
  970.      # We need to know -static, to get the right output filenames.
  971. @@ -604,13 +844,23 @@
  972.      do
  973.        case "$arg" in
  974.        -all-static | -static)
  975. -        if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  976. +    if test "X$arg" = "X-all-static"; then
  977. +      if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  978.          $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  979. -        fi
  980. -        build_libtool_libs=no
  981. +      fi
  982. +      if test -n "$link_static_flag"; then
  983. +        dlopen_self=$dlopen_self_static
  984. +      fi
  985. +    else
  986. +      if test -z "$pic_flag" && test -n "$link_static_flag"; then
  987. +        dlopen_self=$dlopen_self_static
  988. +      fi
  989. +    fi
  990. +    build_libtool_libs=no
  991.      build_old_libs=yes
  992. -        break
  993. -        ;;
  994. +    prefer_static_libs=yes
  995. +    break
  996. +    ;;
  997.        esac
  998.      done
  999.  
  1000. @@ -624,31 +874,58 @@
  1001.  
  1002.        # If the previous option needs an argument, assign it.
  1003.        if test -n "$prev"; then
  1004. -        case "$prev" in
  1005. -        output)
  1006. -          compile_command="$compile_command @OUTPUT@"
  1007. -          finalize_command="$finalize_command @OUTPUT@"
  1008. -          ;;
  1009. -        esac
  1010. -
  1011. -        case "$prev" in
  1012. -        dlfiles|dlprefiles)
  1013. -          case "$arg" in
  1014. -          *.la | *.lo) ;;  # We handle these cases below.
  1015. -          *)
  1016. -            dlprefiles="$dlprefiles $arg"
  1017. -            test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
  1018. -            prev=
  1019. -            ;;
  1020. -          esac
  1021. -          ;;
  1022. -    exportsyms)
  1023. +    case "$prev" in
  1024. +    output)
  1025. +      compile_command="$compile_command @OUTPUT@"
  1026. +      finalize_command="$finalize_command @OUTPUT@"
  1027. +      ;;
  1028. +    esac
  1029. +
  1030. +    case "$prev" in
  1031. +    dlfiles|dlprefiles)
  1032. +      if test "$preload" = no; then
  1033. +        # Add the symbol object into the linking commands.
  1034. +        compile_command="$compile_command @SYMFILE@"
  1035. +        finalize_command="$finalize_command @SYMFILE@"
  1036. +        preload=yes
  1037. +      fi
  1038. +      case "$arg" in
  1039. +      *.la | *.lo) ;;  # We handle these cases below.
  1040. +      self)
  1041. +        if test "$prev" = dlprefiles; then
  1042. +          dlself=yes
  1043. +        elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  1044. +          dlself=yes
  1045. +        else
  1046. +          dlself=needless
  1047. +          export_dynamic=yes
  1048. +        fi
  1049. +        prev=
  1050. +        continue
  1051. +        ;;
  1052. +      *)
  1053. +        if test "$prev" = dlfiles; then
  1054. +          dlfiles="$dlfiles $arg"
  1055. +        else
  1056. +          dlprefiles="$dlprefiles $arg"
  1057. +        fi
  1058. +        prev=
  1059. +        ;;
  1060. +      esac
  1061. +      ;;
  1062. +    expsyms)
  1063.        export_symbols="$arg"
  1064. -          if test ! -f "$arg"; then
  1065. -            $echo "$modename: symbol file \`$arg' does not exist"
  1066. -            exit 1
  1067. -          fi
  1068. +      if test ! -f "$arg"; then
  1069. +        $echo "$modename: symbol file \`$arg' does not exist"
  1070. +        exit 1
  1071. +      fi
  1072.        prev=
  1073. +      continue
  1074. +      ;;
  1075. +    expsyms_regex)
  1076. +      export_symbols_regex="$arg"
  1077. +      prev=
  1078. +      continue
  1079.        ;;
  1080.      release)
  1081.        release="-$arg"
  1082. @@ -655,17 +932,35 @@
  1083.        prev=
  1084.        continue
  1085.        ;;
  1086. -        rpath)
  1087. -          rpath="$rpath $arg"
  1088. +    rpath | xrpath)
  1089. +      # We need an absolute path.
  1090. +      case "$arg" in
  1091. +      [\\/]* | [A-Za-z]:[\\/]*) ;;
  1092. +      *)
  1093. +        $echo "$modename: only absolute run-paths are allowed" 1>&2
  1094. +        exit 1
  1095. +        ;;
  1096. +      esac
  1097. +      if test "$prev" = rpath; then
  1098. +        case "$rpath " in
  1099. +        *" $arg "*) ;;
  1100. +        *) rpath="$rpath $arg" ;;
  1101. +        esac
  1102. +      else
  1103. +        case "$xrpath " in
  1104. +        *" $arg "*) ;;
  1105. +        *) xrpath="$xrpath $arg" ;;
  1106. +        esac
  1107. +      fi
  1108. +      prev=
  1109. +      continue
  1110. +      ;;
  1111. +    *)
  1112. +      eval "$prev=\"\$arg\""
  1113.        prev=
  1114.        continue
  1115.        ;;
  1116. -        *)
  1117. -          eval "$prev=\"\$arg\""
  1118. -          prev=
  1119. -          continue
  1120. -          ;;
  1121. -        esac
  1122. +    esac
  1123.        fi
  1124.  
  1125.        prevarg="$arg"
  1126. @@ -673,10 +968,10 @@
  1127.        case "$arg" in
  1128.        -all-static)
  1129.      if test -n "$link_static_flag"; then
  1130. -          compile_command="$compile_command $link_static_flag"
  1131. +      compile_command="$compile_command $link_static_flag"
  1132.        finalize_command="$finalize_command $link_static_flag"
  1133. -        fi
  1134. -        continue
  1135. +    fi
  1136. +    continue
  1137.      ;;
  1138.  
  1139.        -allow-undefined)
  1140. @@ -685,68 +980,97 @@
  1141.      continue
  1142.      ;;
  1143.  
  1144. +      -avoid-version)
  1145. +    avoid_version=yes
  1146. +    continue
  1147. +    ;;
  1148. +
  1149.        -dlopen)
  1150. -        prev=dlfiles
  1151. -        continue
  1152. -        ;;
  1153. +    prev=dlfiles
  1154. +    continue
  1155. +    ;;
  1156.  
  1157.        -dlpreopen)
  1158. -        prev=dlprefiles
  1159. -        continue
  1160. -        ;;
  1161. +    prev=dlprefiles
  1162. +    continue
  1163. +    ;;
  1164.  
  1165.        -export-dynamic)
  1166. -        if test "$export_dynamic" != yes; then
  1167. -          export_dynamic=yes
  1168. -      if test -n "$export_dynamic_flag_spec"; then
  1169. -        eval arg=\"$export_dynamic_flag_spec\"
  1170. -      else
  1171. -        arg=
  1172. -      fi
  1173. +    export_dynamic=yes
  1174. +    continue
  1175. +    ;;
  1176.  
  1177. -          # Add the symbol object into the linking commands.
  1178. -      compile_command="$compile_command @SYMFILE@"
  1179. -      finalize_command="$finalize_command @SYMFILE@"
  1180. -        fi
  1181. -        ;;
  1182. -
  1183. -      -export-symbols)
  1184. -        if test -n "$export_symbols"; then
  1185. -          $echo "$modename: cannot have more than one -exported-symbols"
  1186. -          exit 1
  1187. -        fi
  1188. -    prev=exportsyms
  1189. +      -export-symbols | -export-symbols-regex)
  1190. +    if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1191. +      $echo "$modename: not more than one -exported-symbols argument allowed"
  1192. +      exit 1
  1193. +    fi
  1194. +    if test "X$arg" = "X-export-symbols"; then
  1195. +      prev=expsyms
  1196. +    else
  1197. +      prev=expsyms_regex
  1198. +    fi
  1199.      continue
  1200. -        ;;
  1201. +    ;;
  1202.  
  1203.        -L*)
  1204. -        dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
  1205. -        case "$dir" in
  1206. -        /* | [A-Za-z]:[/\\]*)
  1207. -      # Add the corresponding hardcode_libdir_flag, if it is not identical.
  1208. -          ;;
  1209. -        *)
  1210. -          $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
  1211. -          exit 1
  1212. -          ;;
  1213. -        esac
  1214. -        deplibs="$deplibs $arg"
  1215. -        lib_search_path="$lib_search_path `expr $arg : '-L\(.*\)'`"
  1216. -        ;;
  1217. +    dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  1218. +    # We need an absolute path.
  1219. +    case "$dir" in
  1220. +    [\\/]* | [A-Za-z]:[\\/]*) ;;
  1221. +    *)
  1222. +      absdir=`cd "$dir" && pwd`
  1223. +      if test -z "$absdir"; then
  1224. +        $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1225. +        exit 1
  1226. +      fi
  1227. +      dir="$absdir"
  1228. +      ;;
  1229. +    esac
  1230. +    case " $deplibs " in
  1231. +    *" $arg "*) ;;
  1232. +    *) deplibs="$deplibs $arg";;
  1233. +    esac
  1234. +    case " $lib_search_path " in
  1235. +    *" $dir "*) ;;
  1236. +    *) lib_search_path="$lib_search_path $dir";;
  1237. +    esac
  1238. +    case "$host" in
  1239. +    *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1240. +      dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  1241. +      case ":$dllsearchpath:" in
  1242. +      ::) dllsearchpath="$dllsearchdir";;
  1243. +      *":$dllsearchdir:"*) ;;
  1244. +      *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
  1245. +      esac
  1246. +      ;;
  1247. +    esac
  1248. +    ;;
  1249.  
  1250. -      -l*) deplibs="$deplibs $arg" ;;
  1251. +      -l*)
  1252. +    if test "$arg" = "-lc"; then
  1253. +      case "$host" in
  1254. +      *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  1255. +        # These systems don't actually have c library (as such)
  1256. +        continue
  1257. +        ;;
  1258. +      esac
  1259. +    elif test "$arg" = "-lm"; then
  1260. +      case "$host" in
  1261. +      *-*-cygwin* | *-*-beos*)
  1262. +        # These systems don't actually have math library (as such)
  1263. +        continue
  1264. +        ;;
  1265. +      esac
  1266. +    fi
  1267. +    deplibs="$deplibs $arg"
  1268. +    ;;
  1269.  
  1270.        -module)
  1271. -        if test "$module" != yes; then
  1272. -          module=yes
  1273. -      if test -n "$export_dynamic_flag_spec"; then
  1274. -        eval arg=\"$export_dynamic_flag_spec\"
  1275. -      else
  1276. -        arg=
  1277. -      fi
  1278. -    fi
  1279. -        ;;
  1280. -    
  1281. +    module=yes
  1282. +    continue
  1283. +    ;;
  1284. +
  1285.        -no-undefined)
  1286.      allow_undefined=no
  1287.      continue
  1288. @@ -760,23 +1084,50 @@
  1289.      ;;
  1290.  
  1291.        -rpath)
  1292. -        prev=rpath
  1293. -        continue
  1294. -        ;;
  1295. +    prev=rpath
  1296. +    continue
  1297. +    ;;
  1298. +
  1299. +      -R)
  1300. +    prev=xrpath
  1301. +    continue
  1302. +    ;;
  1303. +
  1304. +      -R*)
  1305. +    dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1306. +    # We need an absolute path.
  1307. +    case "$dir" in
  1308. +    [\\/]* | [A-Za-z]:[\\/]*) ;;
  1309. +    *)
  1310. +      $echo "$modename: only absolute run-paths are allowed" 1>&2
  1311. +      exit 1
  1312. +      ;;
  1313. +    esac
  1314. +    case "$xrpath " in
  1315. +    *" $dir "*) ;;
  1316. +    *) xrpath="$xrpath $dir" ;;
  1317. +    esac
  1318. +    continue
  1319. +    ;;
  1320.  
  1321.        -static)
  1322.      # If we have no pic_flag, then this is the same as -all-static.
  1323.      if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1324. -          compile_command="$compile_command $link_static_flag"
  1325. +      compile_command="$compile_command $link_static_flag"
  1326.        finalize_command="$finalize_command $link_static_flag"
  1327. -        fi
  1328. +    fi
  1329. +    continue
  1330. +    ;;
  1331. +
  1332. +      -thread-safe)
  1333. +    thread_safe=yes
  1334.      continue
  1335.      ;;
  1336.  
  1337.        -version-info)
  1338. -        prev=vinfo
  1339. -        continue
  1340. -        ;;
  1341. +    prev=vinfo
  1342. +    continue
  1343. +    ;;
  1344.  
  1345.        # Some other compiler flag.
  1346.        -* | +*)
  1347. @@ -788,18 +1139,18 @@
  1348.        arg="\"$arg\""
  1349.        ;;
  1350.      esac
  1351. -        ;;
  1352. +    ;;
  1353.  
  1354.        *.o | *.obj | *.a | *.lib)
  1355. -        # A standard object.
  1356. -        objs="$objs $arg"
  1357. -        ;;
  1358. +    # A standard object.
  1359. +    objs="$objs $arg"
  1360. +    ;;
  1361.  
  1362.        *.lo)
  1363. -        # A library object.
  1364. +    # A library object.
  1365.      if test "$prev" = dlfiles; then
  1366.        dlfiles="$dlfiles $arg"
  1367. -      if test "$build_libtool_libs" = yes; then
  1368. +      if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
  1369.          prev=
  1370.          continue
  1371.        else
  1372. @@ -814,46 +1165,47 @@
  1373.        prev=
  1374.      fi
  1375.      libobjs="$libobjs $arg"
  1376. -        ;;
  1377. +    ;;
  1378.  
  1379.        *.la)
  1380. -        # A libtool-controlled library.
  1381. +    # A libtool-controlled library.
  1382. +
  1383. +    dlname=
  1384. +    libdir=
  1385. +    library_names=
  1386. +    old_library=
  1387.  
  1388. -        dlname=
  1389. -        libdir=
  1390. -        library_names=
  1391. -        old_library=
  1392. -
  1393. -        # Check to see that this really is a libtool archive.
  1394. -        if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1395. -        else
  1396. -          $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
  1397. -          exit 1
  1398. -        fi
  1399. +    # Check to see that this really is a libtool archive.
  1400. +    if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1401. +    else
  1402. +      $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
  1403. +      exit 1
  1404. +    fi
  1405.  
  1406.      # If the library was installed with an old release of libtool,
  1407.      # it will not redefine variable installed.
  1408.      installed=yes
  1409.  
  1410. -        # If there is no directory component, then add one.
  1411. -        case "$arg" in
  1412. -        */* | *\\*) . $arg ;;
  1413. -        *) . ./$arg ;;
  1414. -        esac
  1415. -
  1416. -        # Get the name of the library we link against.
  1417. -        linklib=
  1418. -        for l in $old_library $library_names; do
  1419. -          linklib="$l"
  1420. -        done
  1421. -
  1422. -        if test -z "$linklib"; then
  1423. -          $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
  1424. -          exit 1
  1425. -        fi
  1426. +    # Read the .la file
  1427. +    # If there is no directory component, then add one.
  1428. +    case "$arg" in
  1429. +    */* | *\\*) . $arg ;;
  1430. +    *) . ./$arg ;;
  1431. +    esac
  1432. +
  1433. +    # Get the name of the library we link against.
  1434. +    linklib=
  1435. +    for l in $old_library $library_names; do
  1436. +      linklib="$l"
  1437. +    done
  1438. +
  1439. +    if test -z "$linklib"; then
  1440. +      $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
  1441. +      exit 1
  1442. +    fi
  1443.  
  1444. -        # Find the relevant object directory and library name.
  1445. -        name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
  1446. +    # Find the relevant object directory and library name.
  1447. +    name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
  1448.  
  1449.      if test "X$installed" = Xyes; then
  1450.        dir="$libdir"
  1451. @@ -866,7 +1218,27 @@
  1452.        fi
  1453.      fi
  1454.  
  1455. -        if test -z "$libdir"; then
  1456. +    if test -n "$dependency_libs"; then
  1457. +      # Extract -R from dependency_libs
  1458. +      temp_deplibs=
  1459. +      for deplib in $dependency_libs; do
  1460. +        case "$deplib" in
  1461. +        -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  1462. +         case " $rpath $xrpath " in
  1463. +         *" $temp_xrpath "*) ;;
  1464. +         *) xrpath="$xrpath $temp_xrpath";;
  1465. +         esac;;
  1466. +        -L*) case "$compile_command $temp_deplibs " in
  1467. +         *" $deplib "*) ;;
  1468. +         *) temp_deplibs="$temp_deplibs $deplib";;
  1469. +         esac;;
  1470. +        *) temp_deplibs="$temp_deplibs $deplib";;
  1471. +        esac
  1472. +      done
  1473. +      dependency_libs="$temp_deplibs"
  1474. +    fi
  1475. +
  1476. +    if test -z "$libdir"; then
  1477.        # It is a libtool convenience library, so add in its objects.
  1478.        convenience="$convenience $dir/$old_library"
  1479.        old_convenience="$old_convenience $dir/$old_library"
  1480. @@ -876,130 +1248,148 @@
  1481.        continue
  1482.      fi
  1483.  
  1484. -        # This library was specified with -dlopen.
  1485. -        if test "$prev" = dlfiles; then
  1486. -          dlfiles="$dlfiles $arg"
  1487. -          if test -z "$dlname" || test "$build_libtool_libs" = no; then
  1488. -            # If there is no dlname or we're linking statically,
  1489. -            # we need to preload.
  1490. -            prev=dlprefiles
  1491. -          else
  1492. -            # We should not create a dependency on this library, but we
  1493. +    # This library was specified with -dlopen.
  1494. +    if test "$prev" = dlfiles; then
  1495. +      dlfiles="$dlfiles $arg"
  1496. +      if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
  1497. +        # If there is no dlname, no dlopen support or we're linking statically,
  1498. +        # we need to preload.
  1499. +        prev=dlprefiles
  1500. +      else
  1501. +        # We should not create a dependency on this library, but we
  1502.          # may need any libraries it requires.
  1503.          compile_command="$compile_command$dependency_libs"
  1504.          finalize_command="$finalize_command$dependency_libs"
  1505. -            prev=
  1506. -            continue
  1507. -          fi
  1508. -        fi
  1509. -
  1510. -        # The library was specified with -dlpreopen.
  1511. -        if test "$prev" = dlprefiles; then
  1512. -          # Prefer using a static library (so that no silly _DYNAMIC symbols
  1513. -          # are required to link).
  1514. -          if test -n "$old_library"; then
  1515. -            dlprefiles="$dlprefiles $dir/$old_library"
  1516. -          else
  1517. -            dlprefiles="$dlprefiles $dir/$linklib"
  1518. -          fi
  1519. -          prev=
  1520. -        fi
  1521. -
  1522. -        if test "$build_libtool_libs" = yes && test -n "$library_names"; then
  1523. -          link_against_libtool_libs="$link_against_libtool_libs $arg"
  1524. -          if test -n "$shlibpath_var"; then
  1525. -            # Make sure the rpath contains only unique directories.
  1526. -            case "$temp_rpath " in
  1527. -            *" $dir "*) ;;
  1528. -            *) temp_rpath="$temp_rpath $dir" ;;
  1529. -            esac
  1530. -          fi
  1531. +        prev=
  1532. +        continue
  1533. +      fi
  1534. +    fi
  1535. +
  1536. +    # The library was specified with -dlpreopen.
  1537. +    if test "$prev" = dlprefiles; then
  1538. +      # Prefer using a static library (so that no silly _DYNAMIC symbols
  1539. +      # are required to link).
  1540. +      if test -n "$old_library"; then
  1541. +        dlprefiles="$dlprefiles $dir/$old_library"
  1542. +      else
  1543. +        dlprefiles="$dlprefiles $dir/$linklib"
  1544. +      fi
  1545. +      prev=
  1546. +    fi
  1547. +
  1548. +    if test -n "$library_names" &&
  1549. +       { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  1550. +      link_against_libtool_libs="$link_against_libtool_libs $arg"
  1551. +      if test -n "$shlibpath_var"; then
  1552. +        # Make sure the rpath contains only unique directories.
  1553. +        case "$temp_rpath " in
  1554. +        *" $dir "*) ;;
  1555. +        *) temp_rpath="$temp_rpath $dir" ;;
  1556. +        esac
  1557. +      fi
  1558.  
  1559. +      # We need an absolute path.
  1560. +      case "$dir" in
  1561. +      [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  1562. +      *)
  1563. +        absdir=`cd "$dir" && pwd`
  1564. +        if test -z "$absdir"; then
  1565. +          $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1566. +          exit 1
  1567. +        fi
  1568. +        ;;
  1569. +      esac
  1570. +      
  1571.        # This is the magic to use -rpath.
  1572. -          if test -n "$hardcode_libdir_flag_spec"; then
  1573. -            if test -n "$hardcode_libdir_separator"; then
  1574. -              if test -z "$hardcode_libdirs"; then
  1575. -                # Put the magic libdir with the hardcode flag.
  1576. -                hardcode_libdirs="$libdir"
  1577. -                libdir="@HARDCODE_LIBDIRS@"
  1578. -              else
  1579. -                # Just accumulate the unique libdirs.
  1580. -        case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  1581. -        *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  1582. -          ;;
  1583. -        *)
  1584. -          hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  1585. -          ;;
  1586. -        esac
  1587. -                libdir=
  1588. -              fi
  1589. -            fi
  1590. -
  1591. -            if test -n "$libdir"; then
  1592. -              eval flag=\"$hardcode_libdir_flag_spec\"
  1593. -
  1594. -              compile_command="$compile_command $flag"
  1595. -              finalize_command="$finalize_command $flag"
  1596. -            fi
  1597. -          elif test -n "$runpath_var"; then
  1598. -            # Do the same for the permanent run path.
  1599. -            case "$perm_rpath " in
  1600. -            *" $libdir "*) ;;
  1601. -            *) perm_rpath="$perm_rpath $libdir" ;;
  1602. -            esac
  1603. -          fi
  1604. +      # Skip directories that are in the system default run-time
  1605. +      # search path, unless they have been requested with -R.
  1606. +      case " $sys_lib_dlsearch_path " in
  1607. +      *" $absdir "*) ;;
  1608. +      *)
  1609. +        case "$compile_rpath " in
  1610. +        *" $absdir "*) ;;
  1611. +        *) compile_rpath="$compile_rpath $absdir" 
  1612. +        esac
  1613. +        ;;
  1614. +      esac
  1615.  
  1616. +      case " $sys_lib_dlsearch_path " in
  1617. +      *" $libdir "*) ;;
  1618. +      *)
  1619. +        case "$finalize_rpath " in
  1620. +        *" $libdir "*) ;;
  1621. +        *) finalize_rpath="$finalize_rpath $libdir"
  1622. +        esac
  1623. +        ;;
  1624. +      esac
  1625.  
  1626.        lib_linked=yes
  1627. -          case "$hardcode_action" in
  1628. -          immediate | unsupported)
  1629. -            if test "$hardcode_direct" = no; then
  1630. -              compile_command="$compile_command $dir/$linklib"
  1631. -            elif test "$hardcode_minus_L" = no; then
  1632. +      case "$hardcode_action" in
  1633. +      immediate | unsupported)
  1634. +        if test "$hardcode_direct" = no; then
  1635. +          compile_command="$compile_command $dir/$linklib"
  1636. +          deplibs="$deplibs $dir/$linklib"
  1637.            case "$host" in
  1638. +          *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1639. +        dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  1640. +        if test -n "$dllsearchpath"; then
  1641. +          dllsearchpath="$dllsearchpath:$dllsearchdir"
  1642. +        else
  1643. +          dllsearchpath="$dllsearchdir"
  1644. +        fi
  1645. +        ;;
  1646. +          esac
  1647. +        elif test "$hardcode_minus_L" = no; then
  1648. +          case "$host" in
  1649.            *-*-sunos*)
  1650. -                compile_shlibpath="$compile_shlibpath$dir:"
  1651. +        compile_shlibpath="$compile_shlibpath$dir:"
  1652.          ;;
  1653.            esac
  1654. -              compile_command="$compile_command -L$dir -l$name"
  1655. -            elif test "$hardcode_shlibpath_var" = no; then
  1656. -              compile_shlibpath="$compile_shlibpath$dir:"
  1657. -              compile_command="$compile_command -l$name"
  1658. +          case "$compile_command " in
  1659. +          *" -L$dir "*) ;;
  1660. +          *) compile_command="$compile_command -L$dir";;
  1661. +          esac
  1662. +          compile_command="$compile_command -l$name"
  1663. +          deplibs="$deplibs -L$dir -l$name"
  1664. +        elif test "$hardcode_shlibpath_var" = no; then
  1665. +          case ":$compile_shlibpath:" in
  1666. +          *":$dir:"*) ;;
  1667. +          *) compile_shlibpath="$compile_shlibpath$dir:";;
  1668. +          esac
  1669. +          compile_command="$compile_command -l$name"
  1670. +          deplibs="$deplibs -l$name"
  1671.          else
  1672.            lib_linked=no
  1673. -            fi
  1674. -            ;;
  1675. +        fi
  1676. +        ;;
  1677.  
  1678. -          relink)
  1679. -            # We need an absolute path.
  1680. -            case "$dir" in
  1681. -            /* | [A-Za-z]:[/\\]*) ;;
  1682. -            *)
  1683. -              absdir=`cd "$dir" && pwd`
  1684. -              if test -z "$absdir"; then
  1685. -                $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1686. -                exit 1
  1687. -              fi
  1688. -              dir="$absdir"
  1689. -              ;;
  1690. -            esac
  1691. -
  1692. -            if test "$hardcode_direct" = yes; then
  1693. -              compile_command="$compile_command $dir/$linklib"
  1694. -            elif test "$hardcode_minus_L" = yes; then
  1695. -              compile_command="$compile_command -L$dir -l$name"
  1696. -            elif test "$hardcode_shlibpath_var" = yes; then
  1697. -              compile_shlibpath="$compile_shlibpath$dir:"
  1698. -              compile_command="$compile_command -l$name"
  1699. +      relink)
  1700. +        if test "$hardcode_direct" = yes; then
  1701. +          compile_command="$compile_command $absdir/$linklib"
  1702. +          deplibs="$deplibs $absdir/$linklib"
  1703. +        elif test "$hardcode_minus_L" = yes; then
  1704. +          case "$compile_command " in
  1705. +          *" -L$absdir "*) ;;
  1706. +          *) compile_command="$compile_command -L$absdir";;
  1707. +          esac
  1708. +          compile_command="$compile_command -l$name"
  1709. +          deplibs="$deplibs -L$absdir -l$name"
  1710. +        elif test "$hardcode_shlibpath_var" = yes; then
  1711. +          case ":$compile_shlibpath:" in
  1712. +          *":$absdir:"*) ;;
  1713. +          *) compile_shlibpath="$compile_shlibpath$absdir:";;
  1714. +          esac
  1715. +          compile_command="$compile_command -l$name"
  1716. +          deplibs="$deplibs -l$name"
  1717.          else
  1718.            lib_linked=no
  1719. -            fi
  1720. -            ;;
  1721. +        fi
  1722. +        ;;
  1723.  
  1724.        *)
  1725.          lib_linked=no
  1726.          ;;
  1727. -          esac
  1728. +      esac
  1729.  
  1730.        if test "$lib_linked" != yes; then
  1731.          $echo "$modename: configuration error: unsupported hardcode properties"
  1732. @@ -1006,24 +1396,35 @@
  1733.          exit 1
  1734.        fi
  1735.  
  1736. -          # Finalize command for both is simple: just hardcode it.
  1737. -          if test "$hardcode_direct" = yes; then
  1738. -            finalize_command="$finalize_command $libdir/$linklib"
  1739. -          elif test "$hardcode_minus_L" = yes; then
  1740. -            finalize_command="$finalize_command -L$libdir -l$name"
  1741. -          elif test "$hardcode_shlibpath_var" = yes; then
  1742. -            finalize_shlibpath="$finalize_shlibpath$libdir:"
  1743. -            finalize_command="$finalize_command -l$name"
  1744. -          else
  1745. -            # We cannot seem to hardcode it, guess we'll fake it.
  1746. -            finalize_command="$finalize_command -L$libdir -l$name"
  1747. -          fi
  1748. -        else
  1749. -          # Transform directly to old archives if we don't build new libraries.
  1750. -          if test -n "$pic_flag" && test -z "$old_library"; then
  1751. -            $echo "$modename: cannot find static library for \`$arg'" 1>&2
  1752. -            exit 1
  1753. -          fi
  1754. +      # Finalize command for both is simple: just hardcode it.
  1755. +      if test "$hardcode_direct" = yes; then
  1756. +        finalize_command="$finalize_command $libdir/$linklib"
  1757. +      elif test "$hardcode_minus_L" = yes; then
  1758. +        case "$finalize_command " in
  1759. +        *" -L$libdir "*) ;;
  1760. +        *) finalize_command="$finalize_command -L$libdir";;
  1761. +        esac
  1762. +        finalize_command="$finalize_command -l$name"
  1763. +      elif test "$hardcode_shlibpath_var" = yes; then
  1764. +        case ":$finalize_shlibpath:" in
  1765. +        *":$libdir:"*) ;;
  1766. +        *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
  1767. +        esac
  1768. +        finalize_command="$finalize_command -l$name"
  1769. +      else
  1770. +        # We cannot seem to hardcode it, guess we'll fake it.
  1771. +        case "$finalize_command " in
  1772. +        *" -L$dir "*) ;;
  1773. +        *) finalize_command="$finalize_command -L$libdir";;
  1774. +        esac
  1775. +        finalize_command="$finalize_command -l$name"
  1776. +      fi
  1777. +    else
  1778. +      # Transform directly to old archives if we don't build new libraries.
  1779. +      if test -n "$pic_flag" && test -z "$old_library"; then
  1780. +        $echo "$modename: cannot find static library for \`$arg'" 1>&2
  1781. +        exit 1
  1782. +      fi
  1783.  
  1784.        # Here we assume that one of hardcode_direct or hardcode_minus_L
  1785.        # is not unsupported.  This is valid on all known static and
  1786. @@ -1033,16 +1434,24 @@
  1787.          compile_command="$compile_command $dir/$linklib"
  1788.          finalize_command="$finalize_command $dir/$linklib"
  1789.        else
  1790. -        compile_command="$compile_command -L$dir -l$name"
  1791. -        finalize_command="$finalize_command -L$dir -l$name"
  1792. +        case "$compile_command " in
  1793. +        *" -L$dir "*) ;;
  1794. +        *) compile_command="$compile_command -L$dir";;
  1795. +        esac
  1796. +        compile_command="$compile_command -l$name"
  1797. +        case "$finalize_command " in
  1798. +        *" -L$dir "*) ;;
  1799. +        *) finalize_command="$finalize_command -L$dir";;
  1800. +        esac
  1801. +        finalize_command="$finalize_command -l$name"
  1802.        fi
  1803. -        fi
  1804. +    fi
  1805.  
  1806.      # Add in any libraries that this one depends upon.
  1807.      compile_command="$compile_command$dependency_libs"
  1808.      finalize_command="$finalize_command$dependency_libs"
  1809.      continue
  1810. -        ;;
  1811. +    ;;
  1812.  
  1813.        # Some other compiler argument.
  1814.        *)
  1815. @@ -1054,7 +1463,7 @@
  1816.        arg="\"$arg\""
  1817.        ;;
  1818.      esac
  1819. -        ;;
  1820. +    ;;
  1821.        esac
  1822.  
  1823.        # Now actually substitute the argument into the commands.
  1824. @@ -1070,14 +1479,16 @@
  1825.        exit 1
  1826.      fi
  1827.  
  1828. -    if test -n "$export_symbols" && test "$module" = yes; then
  1829. -      $echo "$modename: \`-export-symbols' is not supported for modules"
  1830. -      exit 1
  1831. +    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1832. +      eval arg=\"$export_dynamic_flag_spec\"
  1833. +      compile_command="$compile_command $arg"
  1834. +      finalize_command="$finalize_command $arg"
  1835.      fi
  1836. -    
  1837. +
  1838.      oldlibs=
  1839.      # calculate the name of the file, without its directory
  1840.      outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1841. +    libobjs_save="$libobjs"
  1842.  
  1843.      case "$output" in
  1844.      "")
  1845. @@ -1088,32 +1499,36 @@
  1846.  
  1847.      *.a | *.lib)
  1848.        if test -n "$link_against_libtool_libs"; then
  1849. -        $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
  1850. -        exit 1
  1851. +    $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
  1852. +    exit 1
  1853.        fi
  1854.  
  1855.        if test -n "$deplibs"; then
  1856. -        $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  1857. +    $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  1858.        fi
  1859.  
  1860. -      if test -n "$dlfiles$dlprefiles"; then
  1861. -        $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  1862. +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1863. +    $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  1864.        fi
  1865.  
  1866.        if test -n "$rpath"; then
  1867. -        $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  1868. +    $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  1869.        fi
  1870.  
  1871. +      if test -n "$xrpath"; then
  1872. +    $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  1873. +      fi
  1874. +
  1875.        if test -n "$vinfo"; then
  1876. -        $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
  1877. +    $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
  1878.        fi
  1879.  
  1880.        if test -n "$release"; then
  1881. -        $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  1882. +    $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  1883.        fi
  1884.  
  1885. -      if test -n "$export_symbols"; then
  1886. -        $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  1887. +      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1888. +    $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  1889.        fi
  1890.  
  1891.        # Now set the variables for building old libraries.
  1892. @@ -1124,42 +1539,46 @@
  1893.      *.la)
  1894.        # Make sure we only generate libraries of the form `libNAME.la'.
  1895.        case "$outputname" in
  1896. -      lib*) ;;
  1897. +      lib*)
  1898. +    name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1899. +    eval libname=\"$libname_spec\"
  1900. +    ;;
  1901.        *)
  1902. -    $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  1903. -    $echo "$help" 1>&2
  1904. -    exit 1
  1905. +    if test "$module" = no; then
  1906. +      $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  1907. +      $echo "$help" 1>&2
  1908. +      exit 1
  1909. +    fi
  1910. +    if test "$need_lib_prefix" != no; then
  1911. +      # Add the "lib" prefix for modules if required
  1912. +      name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1913. +      eval libname=\"$libname_spec\"
  1914. +    else
  1915. +      libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1916. +    fi
  1917.      ;;
  1918.        esac
  1919.  
  1920. -      name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1921. -      eval libname=\"$libname_spec\"
  1922. -
  1923.        output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1924.        if test "X$output_objdir" = "X$output"; then
  1925. -        output_objdir="$objdir"
  1926. +    output_objdir="$objdir"
  1927.        else
  1928. -        output_objdir="$output_objdir/$objdir"
  1929. +    output_objdir="$output_objdir/$objdir"
  1930.        fi
  1931.  
  1932. -      # All the library-specific variables (install_libdir is set above).
  1933. -      library_names=
  1934. -      old_library=
  1935. -      dlname=
  1936. -
  1937.        if test -n "$objs"; then
  1938. -        $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
  1939. -        exit 1
  1940. +    $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
  1941. +    exit 1
  1942.        fi
  1943.  
  1944.        # How the heck are we supposed to write a wrapper for a shared library?
  1945.        if test -n "$link_against_libtool_libs"; then
  1946. -        $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
  1947. -        exit 1
  1948. +     $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
  1949. +     exit 1
  1950.        fi
  1951.  
  1952. -      if test -n "$dlfiles$dlprefiles"; then
  1953. -        $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
  1954. +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1955. +    $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
  1956.        fi
  1957.  
  1958.        set dummy $rpath
  1959. @@ -1170,10 +1589,13 @@
  1960.  
  1961.        oldlibs=
  1962.        if test -z "$rpath"; then
  1963. -    # Building a libtool convenience library.
  1964. -        libext=al
  1965. -    oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1966. -    build_libtool_libs=convenience
  1967. +    if test "$build_libtool_libs" = yes; then
  1968. +      # Building a libtool convenience library.
  1969. +      libext=al
  1970. +      oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1971. +      build_libtool_libs=convenience
  1972. +      build_old_libs=yes
  1973. +    fi
  1974.      dependency_libs="$deplibs"
  1975.  
  1976.      if test -n "$vinfo"; then
  1977. @@ -1241,6 +1663,20 @@
  1978.      case "$version_type" in
  1979.      none) ;;
  1980.  
  1981. +    irix)
  1982. +      major=`expr $current - $age + 1`
  1983. +      versuffix="$major.$revision"
  1984. +      verstring="sgi$major.$revision"
  1985. +
  1986. +      # Add in all the interfaces that we are compatible with.
  1987. +      loop=$revision
  1988. +      while test $loop != 0; do
  1989. +        iface=`expr $revision - $loop`
  1990. +        loop=`expr $loop - 1`
  1991. +        verstring="sgi$major.$iface:$verstring"
  1992. +      done
  1993. +      ;;
  1994. +
  1995.      linux)
  1996.        major=.`expr $current - $age`
  1997.        versuffix="$major.$age.$revision"
  1998. @@ -1295,15 +1731,21 @@
  1999.      # Clear the version info if we defaulted, and they specified a release.
  2000.      if test -z "$vinfo" && test -n "$release"; then
  2001.        major=
  2002. -      versuffix=
  2003.        verstring="0.0"
  2004. -      case "$host" in
  2005. -      *-*-sunos*)
  2006. +      if test "$need_version" = no; then
  2007. +        versuffix=
  2008. +      else
  2009.          versuffix=".0.0"
  2010. -        ;;
  2011. -      esac
  2012. +      fi
  2013.      fi
  2014.  
  2015. +    # Remove version info from name if versioning should be avoided
  2016. +    if test "$avoid_version" = yes && test "$need_version" = no; then
  2017. +      major=
  2018. +      versuffix=
  2019. +      verstring=""
  2020. +    fi
  2021. +    
  2022.      # Check to see if the archive will have undefined symbols.
  2023.      if test "$allow_undefined" = yes; then
  2024.        if test "$allow_undefined_flag" = unsupported; then
  2025. @@ -1316,22 +1758,29 @@
  2026.        allow_undefined_flag="$no_undefined_flag"
  2027.      fi
  2028.  
  2029. -    # Add libc to deplibs on all systems.
  2030.      dependency_libs="$deplibs"
  2031. -    deplibs="$deplibs -lc"
  2032. +    case "$host" in
  2033. +    *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  2034. +      # these systems don't actually have a c library (as such)!
  2035. +      ;;
  2036. +    *)
  2037. +      # Add libc to deplibs on all other systems.
  2038. +      deplibs="$deplibs -lc"
  2039. +      ;;
  2040. +    esac
  2041.        fi
  2042.  
  2043.        # Create the output directory, or remove our outputs if we need to.
  2044.        if test -d $output_objdir; then
  2045. -        $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
  2046. +    $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
  2047.      $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
  2048.        else
  2049. -        $show "$mkdir $output_objdir"
  2050. -        $run $mkdir $output_objdir
  2051. -        status=$?
  2052. -        if test $status -ne 0 && test ! -d $output_objdir; then
  2053. -          exit $status
  2054. -        fi
  2055. +    $show "$mkdir $output_objdir"
  2056. +    $run $mkdir $output_objdir
  2057. +    status=$?
  2058. +    if test $status -ne 0 && test ! -d $output_objdir; then
  2059. +      exit $status
  2060. +    fi
  2061.        fi
  2062.  
  2063.        # Now set the variables for building old libraries.
  2064. @@ -1339,173 +1788,220 @@
  2065.      oldlibs="$oldlibs $output_objdir/$libname.$libext"
  2066.  
  2067.      # Transform .lo files to .o files.
  2068. -    oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^   ]*\.'${libext}' //g' -e "$los2o" -e 's/ $//g'`
  2069. +    oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  2070.        fi
  2071.  
  2072.        if test "$build_libtool_libs" = yes; then
  2073. -        # Transform deplibs into only deplibs that can be linked in shared.
  2074. -        ## Gordon: Do you check for the existence of the libraries in deplibs
  2075. -        ## on the system?  That should maybe be merged in here someplace....
  2076. -        ## Actually: I think test_compile and file_magic do this... file_regex
  2077. -        ## sorta does this. Only pas_all needs to be changed.  -Toshio
  2078. -        name_save=$name
  2079. -        libname_save=$libname
  2080. -        release_save=$release
  2081. -        versuffix_save=$versuffix
  2082. -        major_save=$major
  2083. -        # I'm not sure if I'm treating the release correctly.  I think
  2084. -        # release should show up in the -l (ie -lgmp5) so we don't want to
  2085. -        # add it in twice.  Is that correct?
  2086. -        release=""
  2087. -        versuffix=""
  2088. -        major=""
  2089. -        newdeplibs=
  2090. -        case "$check_shared_deplibs_method" in
  2091. -        pass_all)  
  2092. -          newdeplibs=$deplibs 
  2093. -                    ;; # Don't check for shared/static.  Everything works.
  2094. -                       # This might be a little naive.  We might want to check
  2095. -                       # whether the library exists or not.  But this is on
  2096. -                       # osf3 & osf4 and I'm not really sure... Just
  2097. -                       # implementing what was already the behaviour.
  2098. -        test_compile)
  2099. -          # This code stresses the "libraries are programs" paradigm to its
  2100. -          # limits. Maybe even breaks it.  We compile a program, linking it
  2101. -          # against the deplibs as a proxy for the library.  Then we can check
  2102. -          # whether they linked in statically or dynamically with ldd.
  2103. -          $rm conftest.c
  2104. -          cat > conftest.c <<EOF
  2105. -          int main() { return 0; }
  2106. +    # Transform deplibs into only deplibs that can be linked in shared.
  2107. +    name_save=$name
  2108. +    libname_save=$libname
  2109. +    release_save=$release
  2110. +    versuffix_save=$versuffix
  2111. +    major_save=$major
  2112. +    # I'm not sure if I'm treating the release correctly.  I think
  2113. +    # release should show up in the -l (ie -lgmp5) so we don't want to
  2114. +    # add it in twice.  Is that correct?
  2115. +    release=""
  2116. +    versuffix=""
  2117. +    major=""
  2118. +    newdeplibs=
  2119. +    droppeddeps=no
  2120. +    case "$deplibs_check_method" in
  2121. +    pass_all)
  2122. +      # Don't check for shared/static.  Everything works.
  2123. +      # This might be a little naive.  We might want to check
  2124. +      # whether the library exists or not.  But this is on
  2125. +      # osf3 & osf4 and I'm not really sure... Just
  2126. +      # implementing what was already the behaviour.
  2127. +      newdeplibs=$deplibs
  2128. +      ;;
  2129. +    test_compile)
  2130. +      # This code stresses the "libraries are programs" paradigm to its
  2131. +      # limits. Maybe even breaks it.  We compile a program, linking it
  2132. +      # against the deplibs as a proxy for the library.  Then we can check
  2133. +      # whether they linked in statically or dynamically with ldd.
  2134. +      $rm conftest.c
  2135. +      cat > conftest.c <<EOF
  2136. +      int main() { return 0; }
  2137.  EOF
  2138. -          $rm a.out
  2139. -          $C_compiler conftest.c $deplibs
  2140. -          if test $? -eq 0 ; then
  2141. -            ldd_output=`ldd a.out`
  2142. -            for i in $deplibs; do
  2143. -              name="`expr $i : '-l\(.*\)'`"
  2144. -              # If $name is empty we are operating on a -L argument.
  2145. -              if test "$name" != "" ; then
  2146. -                libname=`eval \\$echo \"$libname_spec\"`
  2147. -                deplib_matches=`eval \\$echo \"$library_names_spec\"`
  2148. -                set dummy $deplib_matches
  2149. -                deplib_match=$2
  2150. -                if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2151. -                  newdeplibs="$newdeplibs $i"
  2152. -                else
  2153. -                  echo
  2154. -                  echo "*** Warning: This library needs some functionality provided by $i."
  2155. -                  echo "*** I have the capability to make that library automatically link in when"
  2156. -                  echo "*** you link to this library.  But I can only do this if you have a"
  2157. -                  echo "*** shared version of the library, which you do not appear to have."
  2158. -                fi
  2159. -              else
  2160. -                newdeplibs="$newdeplibs $i"
  2161. -              fi
  2162. -            done
  2163. -          else
  2164. -            # Error occured in the first compile.  Let's try to salvage the situation:
  2165. -            # Compile a seperate program for each library.
  2166. -            for i in $deplibs; do
  2167. -              name="`expr $i : '-l\(.*\)'`"
  2168. -             # If $name is empty we are operating on a -L argument.
  2169. -              if test "$name" != "" ; then
  2170. -                $rm a.out
  2171. -                $C_compiler conftest.c $i
  2172. -                # Did it work?
  2173. -                if test $? -eq 0 ; then
  2174. -                  ldd_output=`ldd a.out`
  2175. -                    libname=`eval \\$echo \"$libname_spec\"`
  2176. -                    deplib_matches=`eval \\$echo \"$library_names_spec\"`
  2177. -                    set dummy $deplib_matches
  2178. -                    deplib_match=$2
  2179. -                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2180. -                      newdeplibs="$newdeplibs $i"
  2181. -                    else
  2182. -                      echo
  2183. -                      echo "*** Warning: This library needs some functionality provided by $i."
  2184. -                      echo "*** I have the capability to make that library automatically link in when"
  2185. -                      echo "*** you link to this library.  But I can only do this if you have a"
  2186. -                      echo "*** shared version of the library, which you do not appear to have."
  2187. -                    fi
  2188. -                else
  2189. -                  echo
  2190. -                  echo "*** Warning!  Library $i is needed by this library but I was not able to"
  2191. -                  echo "***  make it link in!  You will probably need to install it or some"
  2192. -                  echo "*** library that it depends on before this library will be fully"
  2193. -                  echo "*** functional.  Installing it before continuing would be even better."
  2194. -                fi
  2195. -              else
  2196. -                newdeplibs="$newdeplibs $i"
  2197. -              fi
  2198. -            done
  2199. -          fi
  2200. -          deplibs=$newdeplibs
  2201. -          ;;
  2202. -        file_magic* | file_regex)
  2203. -          set dummy $check_shared_deplibs_method
  2204. -          file_magic_regex="`expr \"$check_shared_deplibs_method\" : \"$2\(.*\)\"`"
  2205. -          for a_deplib in $deplibs; do
  2206. -            name="`expr $a_deplib : '-l\(.*\)'`"
  2207. -            # If $name is empty we are operating on a -L argument.
  2208. -            if test "$name" != "" ; then
  2209. -              libname=`eval \\$echo \"$libname_spec\"`
  2210. -              case "$check_shared_deplibs_method" in
  2211. -                file_magic*)
  2212. -                  for i in $lib_search_path; do
  2213. -                   # This needs to be more general than file_regex in order to
  2214. -                   # catch things like glibc on linux.  Maybe file_regex
  2215. -                   # should be more general as well, but maybe not.  Since
  2216. -                   # library names are supposed to conform to
  2217. -                   # library_name_spec, I think file_regex should remain
  2218. -                   # strict.  What do you think Gordon?
  2219. -                    potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  2220. -                    for potent_lib in $potential_libs; do
  2221. -                      file_output=`file $potent_lib`
  2222. -                      if test `expr "$file_output" : ".*$file_magic_regex"` -ne 0 ; then
  2223. -                        newdeplibs="$newdeplibs $a_deplib"
  2224. -                        a_deplib=""
  2225. -                        break 2
  2226. -                      fi
  2227. -                    done
  2228. -                  done
  2229. -                  ;;
  2230. -                file_regex)
  2231. -                  deplib_matches=`eval \\$echo \"$library_names_spec\"`
  2232. -                  set dummy $deplib_matches
  2233. -                  deplib_match=$2
  2234. -                  for i in $lib_search_path; do
  2235. -                    potential_libs=`ls $i/$deplib_match* 2>/dev/null`
  2236. -                    if test "$potential_libs" != "" ; then
  2237. -                      newdeplibs="$newdeplibs $a_deplib"
  2238. -                      a_deplib=""
  2239. -                      break
  2240. -                    fi
  2241. -                  done
  2242. -                  ;;
  2243. -              esac
  2244. -              if test "$a_deplib" != "" ; then
  2245. -                echo
  2246. -                echo "*** Warning: This library needs some functionality provided by $a_deplib."
  2247. -                echo "*** I have the capability to make that library automatically link in when"
  2248. -                echo "*** you link to this library.  But I can only do this if you have a"
  2249. -                echo "*** shared version of the library, which you do not appear to have."
  2250. -              fi
  2251. -            else
  2252. -              # Add a -L argument.
  2253. -              newdeplibs="$newdeplibs $a_deplib"
  2254. -            fi
  2255. -          done # Gone through all deplibs.
  2256. -          ;;
  2257. -        none | *)  deplibs="" ;;
  2258. -        esac
  2259. -        versuffix=$versuffix_save
  2260. -        major=$major_save
  2261. -        release=$release_save
  2262. -        libname=$libname_save
  2263. -        name=$name_save
  2264. -        deplibs=$newdeplibs
  2265. -        # Done checking deplibs!
  2266. +      $rm conftest
  2267. +      $C_compiler -o conftest conftest.c $deplibs
  2268. +      if test $? -eq 0 ; then
  2269. +        ldd_output=`ldd conftest`
  2270. +        for i in $deplibs; do
  2271. +          name="`expr $i : '-l\(.*\)'`"
  2272. +          # If $name is empty we are operating on a -L argument.
  2273. +          if test "$name" != "" ; then
  2274. +        libname=`eval \\$echo \"$libname_spec\"`
  2275. +        deplib_matches=`eval \\$echo \"$library_names_spec\"`
  2276. +        set dummy $deplib_matches
  2277. +        deplib_match=$2
  2278. +        if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2279. +          newdeplibs="$newdeplibs $i"
  2280. +        else
  2281. +          droppeddeps=yes
  2282. +          echo
  2283. +          echo "*** Warning: This library needs some functionality provided by $i."
  2284. +          echo "*** I have the capability to make that library automatically link in when"
  2285. +          echo "*** you link to this library.  But I can only do this if you have a"
  2286. +          echo "*** shared version of the library, which you do not appear to have."
  2287. +        fi
  2288. +          else
  2289. +        newdeplibs="$newdeplibs $i"
  2290. +          fi
  2291. +        done
  2292. +      else
  2293. +        # Error occured in the first compile.  Let's try to salvage the situation:
  2294. +        # Compile a seperate program for each library.
  2295. +        for i in $deplibs; do
  2296. +          name="`expr $i : '-l\(.*\)'`"
  2297. +         # If $name is empty we are operating on a -L argument.
  2298. +          if test "$name" != "" ; then
  2299. +        $rm conftest
  2300. +        $C_compiler -o conftest conftest.c $i
  2301. +        # Did it work?
  2302. +        if test $? -eq 0 ; then
  2303. +          ldd_output=`ldd conftest`
  2304. +          libname=`eval \\$echo \"$libname_spec\"`
  2305. +          deplib_matches=`eval \\$echo \"$library_names_spec\"`
  2306. +          set dummy $deplib_matches
  2307. +          deplib_match=$2
  2308. +          if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2309. +            newdeplibs="$newdeplibs $i"
  2310. +          else
  2311. +            droppeddeps=yes
  2312. +            echo
  2313. +            echo "*** Warning: This library needs some functionality provided by $i."
  2314. +            echo "*** I have the capability to make that library automatically link in when"
  2315. +            echo "*** you link to this library.  But I can only do this if you have a"
  2316. +            echo "*** shared version of the library, which you do not appear to have."
  2317. +          fi
  2318. +        else
  2319. +          droppeddeps=yes
  2320. +          echo
  2321. +          echo "*** Warning!  Library $i is needed by this library but I was not able to"
  2322. +          echo "***  make it link in!  You will probably need to install it or some"
  2323. +          echo "*** library that it depends on before this library will be fully"
  2324. +          echo "*** functional.  Installing it before continuing would be even better."
  2325. +        fi
  2326. +          else
  2327. +        newdeplibs="$newdeplibs $i"
  2328. +          fi
  2329. +        done
  2330. +      fi
  2331. +      ;;
  2332. +    file_magic*)
  2333. +      set dummy $deplibs_check_method
  2334. +      file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
  2335. +      for a_deplib in $deplibs; do
  2336. +        name="`expr $a_deplib : '-l\(.*\)'`"
  2337. +        # If $name is empty we are operating on a -L argument.
  2338. +        if test "$name" != "" ; then
  2339. +          libname=`eval \\$echo \"$libname_spec\"`
  2340. +          for i in $lib_search_path; do
  2341. +            potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  2342. +            for potent_lib in $potential_libs; do
  2343. +              # Follow soft links.
  2344. +              if ls -lLd "$potlib" 2>/dev/null \
  2345. +             | grep " -> " >/dev/null; then
  2346. +            continue 
  2347. +              fi
  2348. +              # The statement above tries to avoid entering an
  2349. +              # endless loop below, in case of cyclic links.
  2350. +              # We might still enter an endless loop, since a link
  2351. +              # loop can be closed while we follow links,
  2352. +              # but so what?
  2353. +              potlib="$potent_lib"
  2354. +              while test -h "$potlib" 2>/dev/null; do
  2355. +            potliblink=`ls -ld $potlib | sed 's/.* -> //'`
  2356. +            case "$potliblink" in
  2357. +            [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  2358. +            *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  2359. +            esac
  2360. +              done
  2361. +              if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  2362. +             | sed 10q \
  2363. +             | egrep "$file_magic_regex" > /dev/null; then
  2364. +            newdeplibs="$newdeplibs $a_deplib"
  2365. +            a_deplib=""
  2366. +            break 2
  2367. +              fi
  2368. +            done
  2369. +          done
  2370. +          if test -n "$a_deplib" ; then
  2371. +        droppeddeps=yes
  2372. +        echo
  2373. +        echo "*** Warning: This library needs some functionality provided by $a_deplib."
  2374. +        echo "*** I have the capability to make that library automatically link in when"
  2375. +        echo "*** you link to this library.  But I can only do this if you have a"
  2376. +        echo "*** shared version of the library, which you do not appear to have."
  2377. +          fi
  2378. +        else
  2379. +          # Add a -L argument.
  2380. +          newdeplibs="$newdeplibs $a_deplib"
  2381. +        fi
  2382. +      done # Gone through all deplibs.
  2383. +      ;;
  2384. +    none | unknown | *)
  2385. +      newdeplibs=""
  2386. +      if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  2387. +           -e 's/ -[LR][^ ]*//g' -e 's/[     ]//g' |
  2388. +         grep . >/dev/null; then
  2389. +        echo
  2390. +        if test "X$deplibs_check_method" = "Xnone"; then
  2391. +          echo "*** Warning: inter-library dependencies are not supported in this platform."
  2392. +        else
  2393. +          echo "*** Warning: inter-library dependencies are not known to be supported."
  2394. +        fi
  2395. +        echo "*** All declared inter-library dependencies are being dropped."
  2396. +        droppeddeps=yes
  2397. +      fi
  2398. +      ;;
  2399. +    esac
  2400. +    versuffix=$versuffix_save
  2401. +    major=$major_save
  2402. +    release=$release_save
  2403. +    libname=$libname_save
  2404. +    name=$name_save
  2405. +
  2406. +    if test "$droppeddeps" = yes; then
  2407. +      if test "$module" = yes; then
  2408. +        echo
  2409. +        echo "*** Warning: libtool could not satisfy all declared inter-library"
  2410. +        echo "*** dependencies of module $libname.  Therefore, libtool will create"
  2411. +        echo "*** a static module, that should work as long as the dlopening"
  2412. +        echo "*** application is linked with the -dlopen flag."
  2413. +        if test -z "$global_symbol_pipe"; then
  2414. +          echo
  2415. +          echo "*** However, this would only work if libtool was able to extract symbol"
  2416. +          echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2417. +          echo "*** not find such a program.  So, this module is probably useless."
  2418. +          echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2419. +        fi
  2420. +        if test "$build_old_libs" = no; then
  2421. +          oldlibs="$output_objdir/$libname.$libext"
  2422. +          build_libtool_libs=module
  2423. +          build_old_libs=yes
  2424. +        else
  2425. +          build_libtool_libs=no
  2426. +        fi
  2427. +      else
  2428. +        echo "*** The inter-library dependencies that have been dropped here will be"
  2429. +        echo "*** automatically added whenever a program is linked with this library"
  2430. +        echo "*** or is declared to -dlopen it."
  2431. +      fi
  2432. +    fi
  2433. +    # Done checking deplibs!
  2434. +    deplibs=$newdeplibs
  2435. +      fi
  2436. +
  2437. +      # All the library-specific variables (install_libdir is set above).
  2438. +      library_names=
  2439. +      old_library=
  2440. +      dlname=
  2441. +      
  2442. +      # Test again, we may have decided not to build it any more
  2443. +      if test "$build_libtool_libs" = yes; then
  2444.      # Get the real and link names of the library.
  2445.      eval library_names=\"$library_names_spec\"
  2446.      set dummy $library_names
  2447. @@ -1524,8 +2020,18 @@
  2448.        linknames="$linknames $link"
  2449.      done
  2450.  
  2451. -    # Use standard objects if they are PIC.
  2452. -    test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e "$los2o" -e 's/ $//g'`
  2453. +    # Ensure that we have .o objects for linkers which dislike .lo
  2454. +    # (e.g. aix) incase we are running --disable-static
  2455. +    for obj in $libobjs; do
  2456. +      oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
  2457. +      if test ! -f $oldobj; then
  2458. +        $show "${LN_S} $obj $oldobj"
  2459. +        $run ${LN_S} $obj $oldobj || exit $?
  2460. +      fi
  2461. +    done
  2462. +
  2463. +    # Use standard objects if they are pic
  2464. +    test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2465.  
  2466.      if test -n "$whole_archive_flag_spec"; then
  2467.        if test -n "$convenience"; then
  2468. @@ -1532,11 +2038,25 @@
  2469.          eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  2470.        fi
  2471.      else
  2472. +      gentop="$output_objdir/${outputname}x"
  2473. +      $show "${rm}r $gentop"
  2474. +      $run ${rm}r "$gentop"
  2475. +      $show "mkdir $gentop"
  2476. +      $run mkdir "$gentop"
  2477. +      status=$?
  2478. +      if test $status -ne 0 && test ! -d "$gentop"; then
  2479. +        exit $status
  2480. +      fi
  2481. +      generated="$generated $gentop"
  2482. +      
  2483.        for xlib in $convenience; do
  2484.          # Extract the objects.
  2485. -        xdir="$xlib"x
  2486. -        generated="$generated $xdir"
  2487. -        xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
  2488. +        case "$xlib" in
  2489. +        [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2490. +        *) xabs=`pwd`"/$xlib" ;;
  2491. +        esac
  2492. +        xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2493. +        xdir="$gentop/$xlib"
  2494.  
  2495.          $show "${rm}r $xdir"
  2496.          $run ${rm}r "$xdir"
  2497. @@ -1546,16 +2066,48 @@
  2498.          if test $status -ne 0 && test ! -d "$xdir"; then
  2499.            exit $status
  2500.          fi
  2501. -        $show "(cd $xdir && $AR x ../$xlib)"
  2502. -        $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
  2503. +        $show "(cd $xdir && $AR x $xabs)"
  2504. +        $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2505.  
  2506. -        libobjs="$libobjs `echo $xdir/*`"
  2507. +        libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
  2508.        done
  2509.      fi
  2510.  
  2511. +    if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  2512. +      eval flag=\"$thread_safe_flag_spec\"
  2513. +      linkopts="$linkopts $flag"
  2514. +    fi
  2515. +
  2516. +    # Prepare the list of exported symbols
  2517. +    if test -z "$export_symbols"; then
  2518. +      if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  2519. +        $show "generating symbol list for \`$libname.la'"
  2520. +        export_symbols="$output_objdir/$libname.exp"
  2521. +        $run $rm $export_symbols
  2522. +        eval cmds=\"$export_symbols_cmds\"
  2523. +        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2524. +        for cmd in $cmds; do
  2525. +          IFS="$save_ifs"
  2526. +          $show "$cmd"
  2527. +          $run eval "$cmd" || exit $?
  2528. +        done
  2529. +        IFS="$save_ifs"
  2530. +        if test -n "$export_symbols_regex"; then
  2531. +          $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  2532. +          $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  2533. +          $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  2534. +          $run eval '$mv "${export_symbols}T" "$export_symbols"'
  2535. +        fi
  2536. +      fi
  2537. +    fi
  2538. +
  2539. +    if test -n "$export_symbols" && test -n "$include_expsyms"; then
  2540. +      $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  2541. +    fi
  2542. +
  2543.      # Do each of the archive commands.
  2544. -    if test -n "$export_symbols" && test -n "$archive_sym_cmds"; then
  2545. -      eval cmds=\"$archive_sym_cmds\"
  2546. +    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  2547. +      eval cmds=\"$archive_expsym_cmds\"
  2548.      else
  2549.        eval cmds=\"$archive_cmds\"
  2550.      fi
  2551. @@ -1570,8 +2122,8 @@
  2552.      # Create links to the real library.
  2553.      for linkname in $linknames; do
  2554.        if test "$realname" != "$linkname"; then
  2555. -        $show "(cd $output_objdir && $LN_S $realname $linkname)"
  2556. -        $run eval '(cd $output_objdir && $LN_S $realname $linkname)' || exit $?
  2557. +        $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  2558. +        $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  2559.        fi
  2560.      done
  2561.  
  2562. @@ -1585,43 +2137,47 @@
  2563.  
  2564.      *.lo | *.o | *.obj)
  2565.        if test -n "$link_against_libtool_libs"; then
  2566. -        $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
  2567. -        exit 1
  2568. +    $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
  2569. +    exit 1
  2570.        fi
  2571.  
  2572.        if test -n "$deplibs"; then
  2573. -        $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  2574. +    $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  2575.        fi
  2576.  
  2577. -      if test -n "$dlfiles$dlprefiles"; then
  2578. -        $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  2579. +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2580. +    $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  2581.        fi
  2582.  
  2583.        if test -n "$rpath"; then
  2584. -        $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  2585. +    $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  2586. +      fi
  2587. +
  2588. +      if test -n "$xrpath"; then
  2589. +    $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  2590.        fi
  2591.  
  2592.        if test -n "$vinfo"; then
  2593. -        $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  2594. +    $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  2595.        fi
  2596.  
  2597.        if test -n "$release"; then
  2598. -        $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  2599. +    $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  2600.        fi
  2601.  
  2602.        case "$output" in
  2603.        *.lo)
  2604. -        if test -n "$objs"; then
  2605. -          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  2606. -          exit 1
  2607. -        fi
  2608. -        libobj="$output"
  2609. -        obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  2610. -        ;;
  2611. +    if test -n "$objs"; then
  2612. +      $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  2613. +      exit 1
  2614. +    fi
  2615. +    libobj="$output"
  2616. +    obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  2617. +    ;;
  2618.        *)
  2619. -        libobj=
  2620. -        obj="$output"
  2621. -        ;;
  2622. +    libobj=
  2623. +    obj="$output"
  2624. +    ;;
  2625.        esac
  2626.  
  2627.        # Delete the old objects.
  2628. @@ -1628,15 +2184,15 @@
  2629.        $run $rm $obj $libobj
  2630.  
  2631.        # Create the old-style object.
  2632. -      reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^       ]*\.'${libext}' //g' -e 's/[^       ]*\.lib //g' -e "$los2o" -e 's/ $//g'`
  2633. +      reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
  2634.  
  2635.        output="$obj"
  2636.        eval cmds=\"$reload_cmds\"
  2637.        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2638.        for cmd in $cmds; do
  2639. -        IFS="$save_ifs"
  2640. -        $show "$cmd"
  2641. -        $run eval "$cmd" || exit $?
  2642. +    IFS="$save_ifs"
  2643. +    $show "$cmd"
  2644. +    $run eval "$cmd" || exit $?
  2645.        done
  2646.        IFS="$save_ifs"
  2647.  
  2648. @@ -1644,29 +2200,31 @@
  2649.        test -z "$libobj" && exit 0
  2650.  
  2651.        if test "$build_libtool_libs" != yes; then
  2652. -        # Create an invalid libtool object if no PIC, so that we don't
  2653. -        # accidentally link it into a program.
  2654. -        $show "echo timestamp > $libobj"
  2655. -        $run eval "echo timestamp > $libobj" || exit $?
  2656. -        exit 0
  2657. +    # Create an invalid libtool object if no PIC, so that we don't
  2658. +    # accidentally link it into a program.
  2659. +    $show "echo timestamp > $libobj"
  2660. +    $run eval "echo timestamp > $libobj" || exit $?
  2661. +    exit 0
  2662.        fi
  2663.  
  2664.        if test -n "$pic_flag"; then
  2665. -        # Only do commands if we really have different PIC objects.
  2666. -        reload_objs="$libobjs"
  2667. -        output="$libobj"
  2668. -        eval cmds=\"$reload_cmds\"
  2669. -        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2670. -        for cmd in $cmds; do
  2671. -          IFS="$save_ifs"
  2672. -          $show "$cmd"
  2673. -          $run eval "$cmd" || exit $?
  2674. -        done
  2675. -        IFS="$save_ifs"
  2676. +    # Only do commands if we really have different PIC objects.
  2677. +    reload_objs="$libobjs"
  2678. +    output="$libobj"
  2679. +    eval cmds=\"$reload_cmds\"
  2680. +    IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2681. +    for cmd in $cmds; do
  2682. +      IFS="$save_ifs"
  2683. +      $show "$cmd"
  2684. +      $run eval "$cmd" || exit $?
  2685. +    done
  2686. +    IFS="$save_ifs"
  2687.        else
  2688. -        # Just create a symlink.
  2689. -        $show "$LN_S $obj $libobj"
  2690. -        $run $LN_S $obj $libobj || exit $?
  2691. +    # Just create a symlink.
  2692. +    $show $rm $libobj
  2693. +    $run $rm $libobj
  2694. +    $show "$LN_S $obj $libobj"
  2695. +    $run $LN_S $obj $libobj || exit $?
  2696.        fi
  2697.  
  2698.        exit 0
  2699. @@ -1675,105 +2233,156 @@
  2700.      # Anything else should be a program.
  2701.      *)
  2702.        if test -n "$vinfo"; then
  2703. -        $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  2704. +    $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  2705.        fi
  2706.  
  2707.        if test -n "$release"; then
  2708. -        $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  2709. +    $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  2710.        fi
  2711.  
  2712. -      if test -n "$rpath"; then
  2713. +      if test "$preload" = yes; then
  2714. +    if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
  2715. +       test "$dlopen_self_static" = unknown; then
  2716. +      $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  2717. +    fi 
  2718. +      fi
  2719. +    
  2720. +      if test -n "$rpath$xrpath"; then
  2721.      # If the user specified any rpath flags, then add them.
  2722. -    for libdir in $rpath; do
  2723. -          if test -n "$hardcode_libdir_flag_spec"; then
  2724. -            if test -n "$hardcode_libdir_separator"; then
  2725. -              if test -z "$hardcode_libdirs"; then
  2726. -                # Put the magic libdir with the hardcode flag.
  2727. -                hardcode_libdirs="$libdir"
  2728. -                libdir="@HARDCODE_LIBDIRS@"
  2729. -              else
  2730. -                # Just accumulate the unique libdirs.
  2731. -        case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2732. -        *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2733. -          ;;
  2734. -        *)
  2735. -          hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2736. -          ;;
  2737. -        esac
  2738. -                libdir=
  2739. -              fi
  2740. -            fi
  2741. -
  2742. -            if test -n "$libdir"; then
  2743. -              eval flag=\"$hardcode_libdir_flag_spec\"
  2744. -
  2745. -              compile_command="$compile_command $flag"
  2746. -              finalize_command="$finalize_command $flag"
  2747. -            fi
  2748. -          elif test -n "$runpath_var"; then
  2749. -            case "$perm_rpath " in
  2750. -            *" $libdir "*) ;;
  2751. -            *) perm_rpath="$perm_rpath $libdir" ;;
  2752. -            esac
  2753. -          fi
  2754. +    for libdir in $rpath $xrpath; do
  2755. +      # This is the magic to use -rpath.
  2756. +      case "$compile_rpath " in
  2757. +      *" $libdir "*) ;;
  2758. +      *) compile_rpath="$compile_rpath $libdir" ;;
  2759. +      esac
  2760. +      case "$finalize_rpath " in
  2761. +      *" $libdir "*) ;;
  2762. +      *) finalize_rpath="$finalize_rpath $libdir" ;;
  2763. +      esac
  2764.      done
  2765.        fi
  2766.  
  2767. -      # Substitute the hardcoded libdirs into the compile commands.
  2768. -      if test -n "$hardcode_libdir_separator"; then
  2769. -    compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
  2770. -    finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
  2771. +      # Now hardcode the library paths
  2772. +      rpath=
  2773. +      hardcode_libdirs=
  2774. +      for libdir in $compile_rpath $finalize_rpath; do
  2775. +    if test -n "$hardcode_libdir_flag_spec"; then
  2776. +      if test -n "$hardcode_libdir_separator"; then
  2777. +        if test -z "$hardcode_libdirs"; then
  2778. +          hardcode_libdirs="$libdir"
  2779. +        else
  2780. +          # Just accumulate the unique libdirs.
  2781. +          case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2782. +          *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2783. +        ;;
  2784. +          *)
  2785. +        hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2786. +        ;;
  2787. +          esac
  2788. +        fi
  2789. +      else
  2790. +        eval flag=\"$hardcode_libdir_flag_spec\"
  2791. +        rpath="$rpath $flag"
  2792. +      fi
  2793. +    elif test -n "$runpath_var"; then
  2794. +      case "$perm_rpath " in
  2795. +      *" $libdir "*) ;;
  2796. +      *) perm_rpath="$perm_rpath $libdir" ;;
  2797. +      esac
  2798. +    fi
  2799. +      done
  2800. +      # Substitute the hardcoded libdirs into the rpath.
  2801. +      if test -n "$hardcode_libdir_separator" &&
  2802. +     test -n "$hardcode_libdirs"; then
  2803. +    libdir="$hardcode_libdirs"
  2804. +    eval rpath=\" $hardcode_libdir_flag_spec\"
  2805. +      fi
  2806. +      compile_rpath="$rpath"
  2807. +
  2808. +      rpath=
  2809. +      hardcode_libdirs=
  2810. +      for libdir in $finalize_rpath; do
  2811. +    if test -n "$hardcode_libdir_flag_spec"; then
  2812. +      if test -n "$hardcode_libdir_separator"; then
  2813. +        if test -z "$hardcode_libdirs"; then
  2814. +          hardcode_libdirs="$libdir"
  2815. +        else
  2816. +          # Just accumulate the unique libdirs.
  2817. +          case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2818. +          *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2819. +        ;;
  2820. +          *)
  2821. +        hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2822. +        ;;
  2823. +          esac
  2824. +        fi
  2825. +      else
  2826. +        eval flag=\"$hardcode_libdir_flag_spec\"
  2827. +        rpath="$rpath $flag"
  2828. +      fi
  2829. +    elif test -n "$runpath_var"; then
  2830. +      case "$finalize_perm_rpath " in
  2831. +      *" $libdir "*) ;;
  2832. +      *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  2833. +      esac
  2834. +    fi
  2835. +      done
  2836. +      # Substitute the hardcoded libdirs into the rpath.
  2837. +      if test -n "$hardcode_libdir_separator" &&
  2838. +     test -n "$hardcode_libdirs"; then
  2839. +    libdir="$hardcode_libdirs"
  2840. +    eval rpath=\" $hardcode_libdir_flag_spec\"
  2841.        fi
  2842. +      finalize_rpath="$rpath"
  2843.  
  2844.        output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  2845.        if test "X$output_objdir" = "X$output"; then
  2846. -        output_objdir="$objdir"
  2847. +    output_objdir="$objdir"
  2848.        else
  2849. -        output_objdir="$output_objdir/$objdir"
  2850. +    output_objdir="$output_objdir/$objdir"
  2851. +      fi
  2852. +
  2853. +      # Create the binary in the object directory, then wrap it.
  2854. +      if test ! -d $output_objdir; then
  2855. +    $show "$mkdir $output_objdir"
  2856. +    $run $mkdir $output_objdir
  2857. +    status=$?
  2858. +    if test $status -ne 0 && test ! -d $output_objdir; then
  2859. +      exit $status
  2860. +    fi
  2861.        fi
  2862.  
  2863.        if test -n "$libobjs" && test "$build_old_libs" = yes; then
  2864. -        # Transform all the library objects into standard objects.
  2865. -        compile_command=`$echo "X$compile_command " | $Xsed -e "$los2o" -e 's/ $//'`
  2866. -        finalize_command=`$echo "X$finalize_command " | $Xsed -e "$los2o" -e 's/ $//'`
  2867. +    # Transform all the library objects into standard objects.
  2868. +    compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2869. +    finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2870.        fi
  2871.  
  2872. -      if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
  2873. -        dlsyms="${outputname}S.c"
  2874. -      else
  2875. -        dlsyms=
  2876. +      dlsyms=
  2877. +      if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; then
  2878. +    if test -n "$NM" && test -n "$global_symbol_pipe"; then
  2879. +      dlsyms="${outputname}S.c"
  2880. +    else
  2881. +      $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  2882. +    fi
  2883.        fi
  2884.  
  2885.        if test -n "$dlsyms"; then
  2886. -        case "$dlsyms" in
  2887. -        "") ;;
  2888. -        *.c)
  2889. -          if test -z "$export_symbols"; then
  2890. -            # Add our own program objects to the preloaded list.
  2891. -            dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e "$los2o" -e 's/ $//'`
  2892. -          fi
  2893. -
  2894. -          # Discover the nlist of each of the dlfiles.
  2895. -          nlist="$objdir/${output}.nm"
  2896. -
  2897. -      if test -d $objdir; then
  2898. -        $show "$rm $nlist ${nlist}T"
  2899. -        $run $rm "$nlist" "${nlist}T"
  2900. -      else
  2901. -        $show "$mkdir $objdir"
  2902. -        $run $mkdir $objdir
  2903. -        status=$?
  2904. -        if test $status -ne 0 && test ! -d $objdir; then
  2905. -          exit $status
  2906. -        fi
  2907. -      fi
  2908. +    case "$dlsyms" in
  2909. +    "") ;;
  2910. +    *.c)
  2911. +      # Discover the nlist of each of the dlfiles.
  2912. +      nlist="$output_objdir/${outputname}.nm"
  2913. +
  2914. +      $show "$rm $nlist ${nlist}S ${nlist}T"
  2915. +      $run $rm "$nlist" "${nlist}S" "${nlist}T"
  2916.  
  2917. -          # Parse the name list into a source file.
  2918. -          $show "creating $objdir/$dlsyms"
  2919. +      # Parse the name list into a source file.
  2920. +      $show "creating $output_objdir/$dlsyms"
  2921.  
  2922. -          $echo > "$objdir/$dlsyms" "\
  2923. +      test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
  2924.  /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  2925. -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
  2926. +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  2927.  
  2928.  #ifdef __cplusplus
  2929.  extern \"C\" {
  2930. @@ -1780,215 +2389,286 @@
  2931.  #endif
  2932.  
  2933.  /* Prevent the only kind of declaration conflicts we can make. */
  2934. -#define dld_preloaded_symbols some_other_symbol
  2935. +#define lt_preloaded_symbols some_other_symbol
  2936.  
  2937.  /* External symbol declarations for the compiler. */\
  2938.  "
  2939.  
  2940. -          if test -n "$export_symbols"; then
  2941. -        sed -e 's/^\(.*\)/\1 \1/' < "$export_symbols" > "$nlist"
  2942. -          fi
  2943. +      if test "$dlself" = yes; then
  2944. +        $show "generating symbol list for \`$output'"
  2945. +
  2946. +        test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
  2947. +
  2948. +        # Add our own program objects to the symbol list.
  2949. +        progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2950. +        for arg in $progfiles; do
  2951. +          $show "extracting global C symbols from \`$arg'"
  2952. +          $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  2953. +        done
  2954. +
  2955. +        if test -n "$exclude_expsyms"; then
  2956. +          $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  2957. +          $run eval '$mv "$nlist"T "$nlist"'
  2958. +        fi
  2959. +        
  2960. +        if test -n "$export_symbols_regex"; then
  2961. +          $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  2962. +          $run eval '$mv "$nlist"T "$nlist"'
  2963. +        fi
  2964. +
  2965. +        # Prepare the list of exported symbols
  2966. +        if test -z "$export_symbols"; then
  2967. +          export_symbols="$output_objdir/$output.exp"
  2968. +          $run $rm $export_symbols
  2969. +          $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  2970. +        else
  2971. +          $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
  2972. +          $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
  2973. +          $run eval 'mv "$nlist"T "$nlist"'
  2974. +        fi
  2975. +      fi
  2976.  
  2977. -          for arg in $dlprefiles; do
  2978. +      for arg in $dlprefiles; do
  2979.          $show "extracting global C symbols from \`$arg'"
  2980. +        name=`echo "$arg" | sed -e 's%^.*/%%'`
  2981. +        $run eval 'echo ": $name " >> "$nlist"'
  2982.          $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  2983. -          done
  2984. +      done
  2985.  
  2986. -          if test -z "$run"; then
  2987. -        # Make sure we at least have an empty file.
  2988. +      if test -z "$run"; then
  2989. +        # Make sure we have at least an empty file.
  2990.          test -f "$nlist" || : > "$nlist"
  2991.  
  2992. +        if test -n "$exclude_expsyms"; then
  2993. +          egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  2994. +          $mv "$nlist"T "$nlist"
  2995. +        fi
  2996. +
  2997.          # Try sorting and uniquifying the output.
  2998. -        if sort "$nlist" | uniq > "$nlist"T; then
  2999. -          mv -f "$nlist"T "$nlist"
  3000. +        if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
  3001. +          :
  3002.          else
  3003. -          $rm "$nlist"T
  3004. +          grep -v "^: " < "$nlist" > "$nlist"S
  3005.          fi
  3006.  
  3007. -        if test -f "$nlist"; then
  3008. -          sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$output_objdir/$dlsyms"
  3009. -          else
  3010. +        if test -f "$nlist"S; then
  3011. +          eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  3012. +        else
  3013.            echo '/* NONE */' >> "$output_objdir/$dlsyms"
  3014. -          fi
  3015. +        fi
  3016.  
  3017.          $echo >> "$output_objdir/$dlsyms" "\
  3018.  
  3019. -#undef dld_preloaded_symbols
  3020. +#undef lt_preloaded_symbols
  3021.  
  3022.  #if defined (__STDC__) && __STDC__
  3023. -# define __ptr_t void *
  3024. +# define lt_ptr_t void *
  3025.  #else
  3026. -# define __ptr_t char *
  3027. +# define lt_ptr_t char *
  3028. +# define const
  3029.  #endif
  3030.  
  3031.  /* The mapping between symbol names and symbols. */
  3032. -struct {
  3033. -  char *name;
  3034. -  __ptr_t address;
  3035. +const struct {
  3036. +  const char *name;
  3037. +  lt_ptr_t address;
  3038.  }
  3039. -dld_preloaded_symbols[] =
  3040. +lt_preloaded_symbols[] =
  3041.  {\
  3042.  "
  3043.  
  3044. -            if test -n "$export_symbols"; then
  3045. -              echo >> "$objdir/$dlsyms" "\
  3046. -  {\"${output}\", (__ptr_t) 0},"
  3047. -          sed 's/^\(.*\)/  {"\1", (__ptr_t) \&\1},/' < "$export_symbols" >> "$objdir/$dlsyms"
  3048. -            fi
  3049. -
  3050. -            for arg in $dlprefiles; do
  3051. -          name=`echo "$arg" | sed -e 's%^.*/%%'`
  3052. -              echo >> "$objdir/$dlsyms" "\
  3053. -  {\"$name\", (__ptr_t) 0},"
  3054. -          eval "$NM $arg | $global_symbol_pipe > '$nlist'"
  3055. -
  3056. -          if test -f "$nlist"; then
  3057. -            sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
  3058. -          else
  3059. -        echo '/* NONE */' >> "$output_objdir/$dlsyms"
  3060. -          fi
  3061. -
  3062. -            done
  3063. -
  3064. -        if test -f "$nlist"; then
  3065. -          sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms"
  3066. -        fi
  3067. +        sed -n -e 's/^: \([^ ]*\) $/  {\"\1\", (lt_ptr_t) 0},/p' \
  3068. +        -e 's/^. \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr_t) \&\2},/p' \
  3069. +          < "$nlist" >> "$output_objdir/$dlsyms"
  3070.  
  3071.          $echo >> "$output_objdir/$dlsyms" "\
  3072. -  {0, (__ptr_t) 0}
  3073. +  {0, (lt_ptr_t) 0}
  3074.  };
  3075.  
  3076. +/* This works around a problem in FreeBSD linker */
  3077. +#ifdef FREEBSD_WORKAROUND
  3078. +static const void *lt_preloaded_setup() {
  3079. +  return lt_preloaded_symbols;
  3080. +}
  3081. +#endif
  3082. +
  3083.  #ifdef __cplusplus
  3084.  }
  3085.  #endif\
  3086.  "
  3087. -          fi
  3088. +      fi
  3089. +
  3090. +      pic_flag_for_symtable=
  3091. +      case "$host" in
  3092. +      # compiling the symbol table file with pic_flag works around
  3093. +      # a FreeBSD bug that causes programs to crash when -lm is
  3094. +      # linked before any other PIC object.  But we must not use
  3095. +      # pic_flag when linking with -static.  The problem exists in
  3096. +      # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  3097. +      *-*-freebsd2*|*-*-freebsd3.0*)
  3098. +        case "$compile_command " in
  3099. +        *" -static "*) ;;
  3100. +        *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
  3101. +        esac
  3102. +      esac
  3103.  
  3104. -          # Now compile the dynamic symbol file.
  3105. -          $show "(cd $objdir && $C_compiler -c$no_builtin_flag \"$dlsyms\")"
  3106. -          $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag "$dlsyms")' || exit $?
  3107. -
  3108. -          # Transform the symbol file into the correct name.
  3109. -          compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
  3110. -          finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
  3111. -      ;;
  3112. -        *)
  3113. -          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  3114. -          exit 1
  3115. -          ;;
  3116. -        esac
  3117. -      elif test "$export_dynamic" != yes; then
  3118. -        test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
  3119. +      # Now compile the dynamic symbol file.
  3120. +      $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  3121. +      $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  3122. +
  3123. +      # Clean up the generated files.
  3124. +      $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
  3125. +      $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
  3126. +
  3127. +      # Transform the symbol file into the correct name.
  3128. +      compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  3129. +      finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  3130. +      ;;
  3131. +    *)
  3132. +      $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  3133. +      exit 1
  3134. +      ;;
  3135. +    esac
  3136.        else
  3137. -        # We keep going just in case the user didn't refer to
  3138. -        # dld_preloaded_symbols.  The linker will fail if global_symbol_pipe
  3139. -        # really was required.
  3140. -        $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  3141. -
  3142. -        # Nullify the symbol file.
  3143. -        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  3144. -        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  3145. +    # We keep going just in case the user didn't refer to
  3146. +    # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
  3147. +    # really was required.
  3148. +
  3149. +    # Nullify the symbol file.
  3150. +    compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  3151. +    finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  3152.        fi
  3153.  
  3154.        if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
  3155. -        # Replace the output file specification.
  3156. -        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  3157. -        finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  3158. -
  3159. -        # We have no uninstalled library dependencies, so finalize right now.
  3160. -        $show "$compile_command"
  3161. -        $run eval "$compile_command"
  3162. -        exit $?
  3163. -      fi
  3164. -
  3165. -      # Replace the output file specification.
  3166. -      compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  3167. -      finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'T%g'`
  3168. -
  3169. -      # Create the binary in the object directory, then wrap it.
  3170. -      if test ! -d $output_objdir; then
  3171. -        $show "$mkdir $output_objdir"
  3172. -    $run $mkdir $output_objdir
  3173. +    # Replace the output file specification.
  3174. +    compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  3175. +    link_command="$compile_command$compile_rpath"
  3176. +
  3177. +    # We have no uninstalled library dependencies, so finalize right now.
  3178. +    $show "$link_command"
  3179. +    $run eval "$link_command"
  3180.      status=$?
  3181. -    if test $status -ne 0 && test ! -d $objdir; then
  3182. -      exit $status
  3183. +    
  3184. +    # Delete the generated files.
  3185. +    if test -n "$dlsyms"; then
  3186. +      $show "$rm $output_objdir/${outputname}S.${objext}"
  3187. +      $run $rm "$output_objdir/${outputname}S.${objext}"
  3188.      fi
  3189. +
  3190. +    exit $status
  3191.        fi
  3192.  
  3193.        if test -n "$shlibpath_var"; then
  3194. -        # We should set the shlibpath_var
  3195. -        rpath=
  3196. -        for dir in $temp_rpath; do
  3197. -          case "$dir" in
  3198. -          /* | [A-Za-z]:[/\\]*)
  3199. -            # Absolute path.
  3200. -            rpath="$rpath$dir:"
  3201. -            ;;
  3202. -          *)
  3203. -            # Relative path: add a thisdir entry.
  3204. -            rpath="$rpath\$thisdir/$dir:"
  3205. -            ;;
  3206. -          esac
  3207. -        done
  3208. -        temp_rpath="$rpath"
  3209. +    # We should set the shlibpath_var
  3210. +    rpath=
  3211. +    for dir in $temp_rpath; do
  3212. +      case "$dir" in
  3213. +      [\\/]* | [A-Za-z]:[\\/]*)
  3214. +        # Absolute path.
  3215. +        rpath="$rpath$dir:"
  3216. +        ;;
  3217. +      *)
  3218. +        # Relative path: add a thisdir entry.
  3219. +        rpath="$rpath\$thisdir/$dir:"
  3220. +        ;;
  3221. +      esac
  3222. +    done
  3223. +    temp_rpath="$rpath"
  3224.        fi
  3225.  
  3226. -      # Delete the old output file.
  3227. -      $run $rm $output
  3228. -
  3229. -      if test -n "$compile_shlibpath"; then
  3230. -        compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
  3231. +      if test -n "$compile_shlibpath$finalize_shlibpath"; then
  3232. +    compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  3233.        fi
  3234.        if test -n "$finalize_shlibpath"; then
  3235. -        finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  3236. +    finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  3237.        fi
  3238.  
  3239. -      if test -n "$runpath_var" && test -n "$perm_rpath"; then
  3240. -        # We should set the runpath_var.
  3241. -        rpath=
  3242. -        for dir in $perm_rpath; do
  3243. -          rpath="$rpath$dir:"
  3244. -        done
  3245. -        compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
  3246. -        finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
  3247. +      compile_var=
  3248. +      finalize_var=
  3249. +      if test -n "$runpath_var"; then
  3250. +    if test -n "$perm_rpath"; then
  3251. +      # We should set the runpath_var.
  3252. +      rpath=
  3253. +      for dir in $perm_rpath; do
  3254. +        rpath="$rpath$dir:"
  3255. +      done
  3256. +      compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  3257. +    fi
  3258. +    if test -n "$finalize_perm_rpath"; then
  3259. +      # We should set the runpath_var.
  3260. +      rpath=
  3261. +      for dir in $finalize_perm_rpath; do
  3262. +        rpath="$rpath$dir:"
  3263. +      done
  3264. +      finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  3265. +    fi
  3266.        fi
  3267.  
  3268.        if test "$hardcode_action" = relink; then
  3269. -        # AGH! Flame the AIX and HP-UX people for me, will ya?
  3270. -        $echo "$modename: warning: this platform doesn\'t like uninstalled shared libraries" 1>&2
  3271. -        $echo "$modename: \`$output' will be relinked during installation" 1>&2
  3272. +    # Fast installation is not supported
  3273. +    link_command="$compile_var$compile_command$compile_rpath"
  3274. +    relink_command="$finalize_var$finalize_command$finalize_rpath"
  3275. +    
  3276. +    $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  3277. +    $echo "$modename: \`$output' will be relinked during installation" 1>&2
  3278. +      else
  3279. +    if test "$fast_install" != no; then
  3280. +      link_command="$finalize_var$compile_command$finalize_rpath"
  3281. +      if test "$fast_install" = yes; then
  3282. +        relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  3283. +      else
  3284. +        # fast_install is set to needless
  3285. +        relink_command=
  3286. +      fi
  3287. +    else
  3288. +      link_command="$compile_var$compile_command$compile_rpath"
  3289. +      relink_command="$finalize_var$finalize_command$finalize_rpath"
  3290. +    fi
  3291.        fi
  3292.  
  3293. -      $show "$compile_command"
  3294. -      $run eval "$compile_command" || exit $?
  3295. +      # Replace the output file specification.
  3296. +      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  3297. +      
  3298. +      # Delete the old output files.
  3299. +      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  3300. +
  3301. +      $show "$link_command"
  3302. +      $run eval "$link_command" || exit $?
  3303.  
  3304.        # Now create the wrapper script.
  3305.        $show "creating $output"
  3306.  
  3307. -      # Quote the finalize command for shipping.
  3308. -      finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
  3309. +      # Quote the relink command for shipping.
  3310. +      if test -n "$relink_command"; then
  3311. +    relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  3312. +      fi
  3313.  
  3314.        # Quote $echo for shipping.
  3315.        if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
  3316.      case "$0" in
  3317. -    /* | [A-Za-z]:[/\\]*) qecho="$SHELL $0 --fallback-echo";;
  3318. +    [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
  3319.      *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
  3320.      esac
  3321.      qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  3322.        else
  3323. -        qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  3324. +    qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  3325.        fi
  3326.  
  3327.        # Only actually do things if our run command is non-null.
  3328.        if test -z "$run"; then
  3329. -        $rm $output
  3330. -        trap "$rm $output; exit 1" 1 2 15
  3331. +    # win32 will think the script is a binary if it has
  3332. +    # a .exe suffix, so we strip it off here.
  3333. +    case $output in
  3334. +      *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
  3335. +    esac
  3336. +    $rm $output
  3337. +    trap "$rm $output; exit 1" 1 2 15
  3338.  
  3339. -        $echo > $output "\
  3340. +    $echo > $output "\
  3341.  #! $SHELL
  3342.  
  3343.  # $output - temporary wrapper script for $objdir/$outputname
  3344. -# Generated by $PROGRAM - GNU $PACKAGE $VERSION
  3345. +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  3346.  #
  3347.  # The $output program cannot be directly executed until all the libtool
  3348.  # libraries that it depends on are installed.
  3349. @@ -1998,7 +2678,7 @@
  3350.  
  3351.  # Sed substitution that helps us do robust quoting.  It backslashifies
  3352.  # metacharacters that are still active within double-quoted strings.
  3353. -Xsed='sed -e s/^X//'
  3354. +Xsed='sed -e 1s/^X//'
  3355.  sed_quote_subst='$sed_quote_subst'
  3356.  
  3357.  # The HP-UX ksh and POSIX shell print the target directory to stdout
  3358. @@ -2005,11 +2685,12 @@
  3359.  # if CDPATH is set.
  3360.  if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
  3361.  
  3362. +relink_command=\"$relink_command\"
  3363. +
  3364.  # This environment variable determines our operation mode.
  3365.  if test \"\$libtool_install_magic\" = \"$magic\"; then
  3366. -  # install mode needs the following variables:
  3367. +  # install mode needs the following variable:
  3368.    link_against_libtool_libs='$link_against_libtool_libs'
  3369. -  finalize_command=\"cd `pwd | sed -e $sed_quote_subst`; $finalize_command\"
  3370.  else
  3371.    # When we are sourced in execute mode, \$file and \$echo are already set.
  3372.    if test \"\$libtool_execute_magic\" != \"$magic\"; then
  3373. @@ -2028,7 +2709,7 @@
  3374.      fi
  3375.    fi\
  3376.  "
  3377. -        $echo >> $output "\
  3378. +    $echo >> $output "\
  3379.  
  3380.    # Find the directory that this script lives in.
  3381.    thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  3382. @@ -2042,7 +2723,7 @@
  3383.      # If there was a directory component, then change thisdir.
  3384.      if test \"x\$destdir\" != \"x\$file\"; then
  3385.        case \"\$destdir\" in
  3386. -      /* | [A-Za-z]:[/\\]*) thisdir=\"\$destdir\" ;;
  3387. +      [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
  3388.        *) thisdir=\"\$thisdir/\$destdir\" ;;
  3389.        esac
  3390.      fi
  3391. @@ -2054,35 +2735,97 @@
  3392.    # Try to get the absolute directory name.
  3393.    absdir=\`cd \"\$thisdir\" && pwd\`
  3394.    test -n \"\$absdir\" && thisdir=\"\$absdir\"
  3395. +"
  3396.  
  3397. +    if test "$fast_install" = yes; then
  3398. +      echo >> $output "\
  3399. +  program=lt-'$outputname'
  3400.    progdir=\"\$thisdir/$objdir\"
  3401. +  
  3402. +  if test ! -f \"\$progdir/\$program\" || \\
  3403. +     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
  3404. +       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  3405. +
  3406. +    file=\"\$\$-\$program\"
  3407. +
  3408. +    if test ! -d \"\$progdir\"; then
  3409. +      $mkdir \"\$progdir\"
  3410. +    else
  3411. +      $rm \"\$progdir/\$file\"
  3412. +    fi"
  3413. +
  3414. +      echo >> $output "\
  3415. +
  3416. +    # relink executable if necessary
  3417. +    if test -n \"\$relink_command\"; then
  3418. +      if (cd \"\$thisdir\" && eval \$relink_command); then :
  3419. +      else
  3420. +    $rm \"\$progdir/\$file\"
  3421. +    exit 1
  3422. +      fi
  3423. +    fi
  3424. +
  3425. +    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  3426. +    { $rm \"\$progdir/\$program\";
  3427. +      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  3428. +    $rm \"\$progdir/\$file\"
  3429. +  fi"
  3430. +    else
  3431. +      echo >> $output "\
  3432.    program='$outputname'
  3433. +  progdir=\"\$thisdir/$objdir\"
  3434. +"
  3435. +    fi
  3436. +
  3437. +    echo >> $output "\
  3438.  
  3439.    if test -f \"\$progdir/\$program\"; then"
  3440.  
  3441. -        # Export our shlibpath_var if we have one.
  3442. -        if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  3443. -          $echo >> $output "\
  3444. +    # Export our shlibpath_var if we have one.
  3445. +    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  3446. +      $echo >> $output "\
  3447.      # Add our own library path to $shlibpath_var
  3448.      $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  3449.  
  3450.      # Some systems cannot cope with colon-terminated $shlibpath_var
  3451. -    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/:*\$//'\`
  3452. +    # The second colon is a workaround for a bug in BeOS R4 sed
  3453. +    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  3454.  
  3455.      export $shlibpath_var
  3456.  "
  3457. -        fi
  3458. +    fi
  3459. +
  3460. +    # fixup the dll searchpath if we need to.
  3461. +    if test -n "$dllsearchpath"; then
  3462. +      $echo >> $output "\
  3463. +    # Add the dll search path components to the executable PATH
  3464. +    PATH=$dllsearchpath:\$PATH
  3465. +"
  3466. +    fi
  3467.  
  3468. -        $echo >> $output "\
  3469. +    $echo >> $output "\
  3470.      if test \"\$libtool_execute_magic\" != \"$magic\"; then
  3471.        # Run the actual program with our arguments.
  3472. -
  3473. +"
  3474. +    case $host in
  3475. +    *-*-cygwin* | *-*-mingw | *-*-os2*)
  3476. +      # win32 systems need to use the prog path for dll
  3477. +      # lookup to work
  3478. +      $echo >> $output "\
  3479. +      exec \$progdir\\\\\$program \${1+\"\$@\"}
  3480. +"
  3481. +      ;;
  3482. +    *)
  3483. +      $echo >> $output "\
  3484.        # Export the path to the program.
  3485.        PATH=\"\$progdir:\$PATH\"
  3486.        export PATH
  3487.  
  3488.        exec \$program \${1+\"\$@\"}
  3489. -
  3490. +"
  3491. +      ;;
  3492. +    esac
  3493. +    $echo >> $output "\
  3494.        \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  3495.        exit 1
  3496.      fi
  3497. @@ -2095,7 +2838,7 @@
  3498.    fi
  3499.  fi\
  3500.  "
  3501. -        chmod +x $output
  3502. +    chmod +x $output
  3503.        fi
  3504.        exit 0
  3505.        ;;
  3506. @@ -2105,46 +2848,78 @@
  3507.      for oldlib in $oldlibs; do
  3508.  
  3509.        if test "$build_libtool_libs" = convenience; then
  3510. -    oldobjs="$libobjs"
  3511. +    oldobjs="$libobjs_save"
  3512.      addlibs="$convenience"
  3513.      build_libtool_libs=no
  3514.        else
  3515. -    oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^   ]*\.'${libext}' //g' -e 's/[^   ]*\.lib //g' -e "$los2o" -e 's/ $//g'`
  3516. +    if test "$build_libtool_libs" = module; then
  3517. +      oldobjs="$libobjs_save"
  3518. +      build_libtool_libs=no
  3519. +    else
  3520. +      oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
  3521. +    fi
  3522.      addlibs="$old_convenience"
  3523.        fi
  3524.  
  3525. -      # Add in members from convenience archives.
  3526. -      for xlib in $addlibs; do
  3527. -    # Extract the objects.
  3528. -    xdir="$xlib"x
  3529. -    generated="$generated $xdir"
  3530. -    xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
  3531. -
  3532. -    $show "${rm}r $xdir"
  3533. -    $run ${rm}r "$xdir"
  3534. -    $show "mkdir $xdir"
  3535. -    $run mkdir "$xdir"
  3536. +      if test -n "$addlibs"; then
  3537. +    gentop="$output_objdir/${outputname}x"
  3538. +    $show "${rm}r $gentop"
  3539. +    $run ${rm}r "$gentop"
  3540. +    $show "mkdir $gentop"
  3541. +    $run mkdir "$gentop"
  3542.      status=$?
  3543. -    if test $status -ne 0 && test ! -d "$xdir"; then
  3544. +    if test $status -ne 0 && test ! -d "$gentop"; then
  3545.        exit $status
  3546.      fi
  3547. -    $show "(cd $xdir && $AR x ../$xlib)"
  3548. -    $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
  3549. +    generated="$generated $gentop"
  3550. +      
  3551. +    # Add in members from convenience archives.
  3552. +    for xlib in $addlibs; do
  3553. +      # Extract the objects.
  3554. +      case "$xlib" in
  3555. +      [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  3556. +      *) xabs=`pwd`"/$xlib" ;;
  3557. +      esac
  3558. +      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  3559. +      xdir="$gentop/$xlib"
  3560.  
  3561. -    oldobjs="$oldobjs `echo $xdir/*`"
  3562. -      done
  3563. +      $show "${rm}r $xdir"
  3564. +      $run ${rm}r "$xdir"
  3565. +      $show "mkdir $xdir"
  3566. +      $run mkdir "$xdir"
  3567. +      status=$?
  3568. +      if test $status -ne 0 && test ! -d "$xdir"; then
  3569. +        exit $status
  3570. +      fi
  3571. +      $show "(cd $xdir && $AR x $xabs)"
  3572. +      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  3573. +
  3574. +      oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
  3575. +    done
  3576. +      fi
  3577.  
  3578.        # Do each command in the archive commands.
  3579.        if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  3580.      eval cmds=\"$old_archive_from_new_cmds\"
  3581.        else
  3582. +    # Ensure that we have .o objects in place incase we decided
  3583. +    # not to build a shared library, and have fallen back to building
  3584. +    # static libs even though --disable-static was passed!
  3585. +    for oldobj in $oldobjs; do
  3586. +      if test ! -f $oldobj; then
  3587. +        obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
  3588. +        $show "${LN_S} $obj $oldobj"
  3589. +        $run ${LN_S} $obj $oldobj || exit $?
  3590. +      fi
  3591. +    done
  3592. +
  3593.      eval cmds=\"$old_archive_cmds\"
  3594.        fi
  3595.        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3596.        for cmd in $cmds; do
  3597. -        IFS="$save_ifs"
  3598. -        $show "$cmd"
  3599. -        $run eval "$cmd" || exit $?
  3600. +    IFS="$save_ifs"
  3601. +    $show "$cmd"
  3602. +    $run eval "$cmd" || exit $?
  3603.        done
  3604.        IFS="$save_ifs"
  3605.      done
  3606. @@ -2161,11 +2936,30 @@
  3607.        test "$build_old_libs" = yes && old_library="$libname.$libext"
  3608.        $show "creating $output"
  3609.  
  3610. +      if test -n "$xrpath"; then
  3611. +    temp_xrpath=
  3612. +    for libdir in $xrpath; do
  3613. +      temp_xrpath="$temp_xrpath -R$libdir"
  3614. +    done
  3615. +    dependency_libs="$temp_xrpath $dependency_libs"
  3616. +      fi
  3617. +
  3618.        # Only create the output if not a dry run.
  3619.        if test -z "$run"; then
  3620. -        $echo > $output "\
  3621. -# $output - a libtool library file
  3622. -# Generated by $PROGRAM - GNU $PACKAGE $VERSION
  3623. +    for installed in no yes; do
  3624. +      if test "$installed" = yes; then
  3625. +        if test -z "$install_libdir"; then
  3626. +          break
  3627. +        fi
  3628. +        output="$output_objdir/$outputname"i
  3629. +      fi
  3630. +      $rm $output
  3631. +      $echo > $output "\
  3632. +# $outputname - a libtool library file
  3633. +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  3634. +#
  3635. +# Please DO NOT delete this file!
  3636. +# It is necessary for linking the library.
  3637.  
  3638.  # The name that we can dlopen(3).
  3639.  dlname='$dlname'
  3640. @@ -2185,17 +2979,18 @@
  3641.  revision=$revision
  3642.  
  3643.  # Is this an already installed library?
  3644. -installed=no
  3645. +installed=$installed
  3646.  
  3647.  # Directory that this library needs to be installed in:
  3648.  libdir='$install_libdir'\
  3649.  "
  3650. +    done
  3651.        fi
  3652.  
  3653.        # Do a symbolic link so that the libtool archive can be found in
  3654.        # LD_LIBRARY_PATH before the program is installed.
  3655. -      $show "(cd $output_objdir && $LN_S ../$outputname $outputname)"
  3656. -      $run eval "(cd $output_objdir && $LN_S ../$outputname $outputname)" || exit $?
  3657. +      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  3658. +      $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
  3659.        ;;
  3660.      esac
  3661.      exit 0
  3662. @@ -2244,9 +3039,9 @@
  3663.      for arg
  3664.      do
  3665.        if test -n "$dest"; then
  3666. -        files="$files $dest"
  3667. -        dest="$arg"
  3668. -        continue
  3669. +    files="$files $dest"
  3670. +    dest="$arg"
  3671. +    continue
  3672.        fi
  3673.  
  3674.        case "$arg" in
  3675. @@ -2256,20 +3051,20 @@
  3676.        -m) prev="-m" ;;
  3677.        -o) prev="-o" ;;
  3678.        -s)
  3679. -        stripme=" -s"
  3680. -        continue
  3681. -        ;;
  3682. +    stripme=" -s"
  3683. +    continue
  3684. +    ;;
  3685.        -*) ;;
  3686.  
  3687.        *)
  3688. -        # If the previous option needed an argument, then skip it.
  3689. -        if test -n "$prev"; then
  3690. -          prev=
  3691. -        else
  3692. -          dest="$arg"
  3693. -          continue
  3694. -        fi
  3695. -        ;;
  3696. +    # If the previous option needed an argument, then skip it.
  3697. +    if test -n "$prev"; then
  3698. +      prev=
  3699. +    else
  3700. +      dest="$arg"
  3701. +      continue
  3702. +    fi
  3703. +    ;;
  3704.        esac
  3705.  
  3706.        # Aesthetically quote the argument.
  3707. @@ -2296,9 +3091,9 @@
  3708.  
  3709.      if test -z "$files"; then
  3710.        if test -z "$dest"; then
  3711. -        $echo "$modename: no file or destination specified" 1>&2
  3712. +    $echo "$modename: no file or destination specified" 1>&2
  3713.        else
  3714. -        $echo "$modename: you must specify a destination" 1>&2
  3715. +    $echo "$modename: you must specify a destination" 1>&2
  3716.        fi
  3717.        $echo "$help" 1>&2
  3718.        exit 1
  3719. @@ -2320,23 +3115,23 @@
  3720.        # Not a directory, so check to see that there is only one file specified.
  3721.        set dummy $files
  3722.        if test $# -gt 2; then
  3723. -        $echo "$modename: \`$dest' is not a directory" 1>&2
  3724. -        $echo "$help" 1>&2
  3725. -        exit 1
  3726. +    $echo "$modename: \`$dest' is not a directory" 1>&2
  3727. +    $echo "$help" 1>&2
  3728. +    exit 1
  3729.        fi
  3730.      fi
  3731.      case "$destdir" in
  3732. -    /* | [A-Za-z]:[/\\]*) ;;
  3733. +    [\\/]* | [A-Za-z]:[\\/]*) ;;
  3734.      *)
  3735.        for file in $files; do
  3736. -        case "$file" in
  3737. -        *.lo) ;;
  3738. -        *)
  3739. -          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  3740. -          $echo "$help" 1>&2
  3741. -          exit 1
  3742. -          ;;
  3743. -        esac
  3744. +    case "$file" in
  3745. +    *.lo) ;;
  3746. +    *)
  3747. +      $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  3748. +      $echo "$help" 1>&2
  3749. +      exit 1
  3750. +      ;;
  3751. +    esac
  3752.        done
  3753.        ;;
  3754.      esac
  3755. @@ -2353,212 +3148,221 @@
  3756.        # Do each installation.
  3757.        case "$file" in
  3758.        *.a | *.lib)
  3759. -        # Do the static libraries later.
  3760. -        staticlibs="$staticlibs $file"
  3761. -        ;;
  3762. +    # Do the static libraries later.
  3763. +    staticlibs="$staticlibs $file"
  3764. +    ;;
  3765.  
  3766.        *.la)
  3767. -        # Check to see that this really is a libtool archive.
  3768. -        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  3769. -        else
  3770. -          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  3771. -          $echo "$help" 1>&2
  3772. -          exit 1
  3773. -        fi
  3774. -
  3775. -        library_names=
  3776. -        old_library=
  3777. -        # If there is no directory component, then add one.
  3778. -        case "$file" in
  3779. -        */* | *\\*) . $file ;;
  3780. -        *) . ./$file ;;
  3781. -        esac
  3782. -
  3783. -        # Add the libdir to current_libdirs if it is the destination.
  3784. -        if test "X$destdir" = "X$libdir"; then
  3785. -          case "$current_libdirs " in
  3786. -          *" $libdir "*) ;;
  3787. -          *) current_libdirs="$current_libdirs $libdir" ;;
  3788. -          esac
  3789. -        else
  3790. -          # Note the libdir as a future libdir.
  3791. -          case "$future_libdirs " in
  3792. -          *" $libdir "*) ;;
  3793. -          *) future_libdirs="$future_libdirs $libdir" ;;
  3794. -          esac
  3795. -        fi
  3796. -
  3797. -        dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
  3798. -        test "X$dir" = "X$file/" && dir=
  3799. -        dir="$dir$objdir"
  3800. -
  3801. -        # See the names of the shared library.
  3802. -        set dummy $library_names
  3803. -        if test -n "$2"; then
  3804. -          realname="$2"
  3805. -          shift
  3806. -          shift
  3807. -
  3808. -          # Install the shared library and build the symlinks.
  3809. -          $show "$install_prog $dir/$realname $destdir/$realname"
  3810. -          $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
  3811. -          test "X$dlname" = "X$realname" && dlname=
  3812. -
  3813. -          if test $# -gt 0; then
  3814. -            # Delete the old symlinks, and create new ones.
  3815. -            for linkname
  3816. -            do
  3817. -              test "X$dlname" = "X$linkname" && dlname=
  3818. +    # Check to see that this really is a libtool archive.
  3819. +    if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  3820. +    else
  3821. +      $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  3822. +      $echo "$help" 1>&2
  3823. +      exit 1
  3824. +    fi
  3825. +
  3826. +    library_names=
  3827. +    old_library=
  3828. +    # If there is no directory component, then add one.
  3829. +    case "$file" in
  3830. +    */* | *\\*) . $file ;;
  3831. +    *) . ./$file ;;
  3832. +    esac
  3833. +
  3834. +    # Add the libdir to current_libdirs if it is the destination.
  3835. +    if test "X$destdir" = "X$libdir"; then
  3836. +      case "$current_libdirs " in
  3837. +      *" $libdir "*) ;;
  3838. +      *) current_libdirs="$current_libdirs $libdir" ;;
  3839. +      esac
  3840. +    else
  3841. +      # Note the libdir as a future libdir.
  3842. +      case "$future_libdirs " in
  3843. +      *" $libdir "*) ;;
  3844. +      *) future_libdirs="$future_libdirs $libdir" ;;
  3845. +      esac
  3846. +    fi
  3847. +
  3848. +    dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
  3849. +    test "X$dir" = "X$file/" && dir=
  3850. +    dir="$dir$objdir"
  3851. +
  3852. +    # See the names of the shared library.
  3853. +    set dummy $library_names
  3854. +    if test -n "$2"; then
  3855. +      realname="$2"
  3856. +      shift
  3857. +      shift
  3858. +
  3859. +      # Install the shared library and build the symlinks.
  3860. +      $show "$install_prog $dir/$realname $destdir/$realname"
  3861. +      $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
  3862. +      test "X$dlname" = "X$realname" && dlname=
  3863. +
  3864. +      if test $# -gt 0; then
  3865. +        # Delete the old symlinks, and create new ones.
  3866. +        for linkname
  3867. +        do
  3868. +          test "X$dlname" = "X$linkname" && dlname=
  3869.            if test "$linkname" != "$realname"; then
  3870.          $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  3871.          $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  3872.            fi
  3873. -            done
  3874. -          fi
  3875. +        done
  3876. +      fi
  3877. +
  3878. +      if test -n "$dlname"; then
  3879. +        # Install the dynamically-loadable library.
  3880. +        $show "$install_prog $dir/$dlname $destdir/$dlname"
  3881. +        $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
  3882. +      fi
  3883.  
  3884. -          if test -n "$dlname"; then
  3885. -            # Install the dynamically-loadable library.
  3886. -            $show "$install_prog $dir/$dlname $destdir/$dlname"
  3887. -            $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
  3888. -          fi
  3889. -
  3890. -          # Do each command in the postinstall commands.
  3891. -          lib="$destdir/$realname"
  3892. -          eval cmds=\"$postinstall_cmds\"
  3893. -          IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3894. -          for cmd in $cmds; do
  3895. -            IFS="$save_ifs"
  3896. -            $show "$cmd"
  3897. -            $run eval "$cmd" || exit $?
  3898. -          done
  3899. -          IFS="$save_ifs"
  3900. -        fi
  3901. +      # Do each command in the postinstall commands.
  3902. +      lib="$destdir/$realname"
  3903. +      eval cmds=\"$postinstall_cmds\"
  3904. +      IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3905. +      for cmd in $cmds; do
  3906. +        IFS="$save_ifs"
  3907. +        $show "$cmd"
  3908. +        $run eval "$cmd" || exit $?
  3909. +      done
  3910. +      IFS="$save_ifs"
  3911. +    fi
  3912.  
  3913. -        # Install the pseudo-library for information purposes.
  3914. -        name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3915. +    # Install the pseudo-library for information purposes.
  3916. +    name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3917.      instname="$dir/$name"i
  3918. -    $show "Creating $instname"
  3919. -    $rm "$instname"
  3920. -    sed 's/^installed=no$/installed=yes/' "$file" > "$instname"
  3921. -        $show "$install_prog $instname $destdir/$name"
  3922. -        $run eval "$install_prog $instname $destdir/$name" || exit $?
  3923. -    $show "$rm $instname"
  3924. -    $rm "$instname"
  3925. -
  3926. -        # Maybe install the static library, too.
  3927. -        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  3928. -        ;;
  3929. +    $show "$install_prog $instname $destdir/$name"
  3930. +    $run eval "$install_prog $instname $destdir/$name" || exit $?
  3931. +
  3932. +    # Maybe install the static library, too.
  3933. +    test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  3934. +    ;;
  3935.  
  3936.        *.lo)
  3937. -        # Install (i.e. copy) a libtool object.
  3938. +    # Install (i.e. copy) a libtool object.
  3939. +
  3940. +    # Figure out destination file name, if it wasn't already specified.
  3941. +    if test -n "$destname"; then
  3942. +      destfile="$destdir/$destname"
  3943. +    else
  3944. +      destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3945. +      destfile="$destdir/$destfile"
  3946. +    fi
  3947. +
  3948. +    # Deduce the name of the destination old-style object file.
  3949. +    case "$destfile" in
  3950. +    *.lo)
  3951. +      staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  3952. +      ;;
  3953. +    *.o | *.obj)
  3954. +      staticdest="$destfile"
  3955. +      destfile=
  3956. +      ;;
  3957. +    *)
  3958. +      $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  3959. +      $echo "$help" 1>&2
  3960. +      exit 1
  3961. +      ;;
  3962. +    esac
  3963.  
  3964. -        # Figure out destination file name, if it wasn't already specified.
  3965. -        if test -n "$destname"; then
  3966. -          destfile="$destdir/$destname"
  3967. -        else
  3968. -          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3969. -          destfile="$destdir/$destfile"
  3970. -        fi
  3971. -
  3972. -        # Deduce the name of the destination old-style object file.
  3973. -        case "$destfile" in
  3974. -        *.lo)
  3975. -          staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  3976. -          ;;
  3977. -        *.o | *.obj)
  3978. -          staticdest="$destfile"
  3979. -          destfile=
  3980. -          ;;
  3981. -        *)
  3982. -          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  3983. -          $echo "$help" 1>&2
  3984. -          exit 1
  3985. -          ;;
  3986. -        esac
  3987. -
  3988. -        # Install the libtool object if requested.
  3989. -        if test -n "$destfile"; then
  3990. -          $show "$install_prog $file $destfile"
  3991. -          $run eval "$install_prog $file $destfile" || exit $?
  3992. -        fi
  3993. -
  3994. -        # Install the old object if enabled.
  3995. -        if test "$build_old_libs" = yes; then
  3996. -          # Deduce the name of the old-style object file.
  3997. -          staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  3998. -
  3999. -          $show "$install_prog $staticobj $staticdest"
  4000. -          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  4001. -        fi
  4002. -        exit 0
  4003. -        ;;
  4004. +    # Install the libtool object if requested.
  4005. +    if test -n "$destfile"; then
  4006. +      $show "$install_prog $file $destfile"
  4007. +      $run eval "$install_prog $file $destfile" || exit $?
  4008. +    fi
  4009. +
  4010. +    # Install the old object if enabled.
  4011. +    if test "$build_old_libs" = yes; then
  4012. +      # Deduce the name of the old-style object file.
  4013. +      staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  4014. +
  4015. +      $show "$install_prog $staticobj $staticdest"
  4016. +      $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  4017. +    fi
  4018. +    exit 0
  4019. +    ;;
  4020.  
  4021.        *)
  4022. -        # Figure out destination file name, if it wasn't already specified.
  4023. -        if test -n "$destname"; then
  4024. -          destfile="$destdir/$destname"
  4025. -        else
  4026. -          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4027. -          destfile="$destdir/$destfile"
  4028. -        fi
  4029. -
  4030. -        # Do a test to see if this is really a libtool program.
  4031. -        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4032. -          link_against_libtool_libs=
  4033. -          finalize_command=
  4034. -
  4035. -          # If there is no directory component, then add one.
  4036. -          case "$file" in
  4037. -          */* | *\\*) . $file ;;
  4038. -          *) . ./$file ;;
  4039. -          esac
  4040. -
  4041. -          # Check the variables that should have been set.
  4042. -          if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
  4043. -            $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
  4044. -            exit 1
  4045. -          fi
  4046. -
  4047. -          finalize=yes
  4048. -          for lib in $link_against_libtool_libs; do
  4049. -            # Check to see that each library is installed.
  4050. -            libdir=
  4051. -            if test -f "$lib"; then
  4052. -              # If there is no directory component, then add one.
  4053. -              case "$lib" in
  4054. -              */* | *\\*) . $lib ;;
  4055. -              *) . ./$lib ;;
  4056. -              esac
  4057. -            fi
  4058. -            libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
  4059. -            if test -n "$libdir" && test ! -f "$libfile"; then
  4060. -              $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  4061. -              finalize=no
  4062. -            fi
  4063. -          done
  4064. -
  4065. -          if test "$hardcode_action" = relink; then
  4066. -            if test "$finalize" = yes; then
  4067. -              $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
  4068. -              $show "$finalize_command"
  4069. -              if $run eval "$finalize_command"; then :
  4070. -              else
  4071. -                $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  4072. -                continue
  4073. -              fi
  4074. -              file="$objdir/$file"T
  4075. -            else
  4076. -              $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
  4077. -            fi
  4078. -          else
  4079. -            # Install the binary that we compiled earlier.
  4080. +    # Figure out destination file name, if it wasn't already specified.
  4081. +    if test -n "$destname"; then
  4082. +      destfile="$destdir/$destname"
  4083. +    else
  4084. +      destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4085. +      destfile="$destdir/$destfile"
  4086. +    fi
  4087. +
  4088. +    # Do a test to see if this is really a libtool program.
  4089. +    if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4090. +      link_against_libtool_libs=
  4091. +      relink_command=
  4092. +
  4093. +      # If there is no directory component, then add one.
  4094. +      case "$file" in
  4095. +      */* | *\\*) . $file ;;
  4096. +      *) . ./$file ;;
  4097. +      esac
  4098. +
  4099. +      # Check the variables that should have been set.
  4100. +      if test -z "$link_against_libtool_libs"; then
  4101. +        $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
  4102. +        exit 1
  4103. +      fi
  4104. +
  4105. +      finalize=yes
  4106. +      for lib in $link_against_libtool_libs; do
  4107. +        # Check to see that each library is installed.
  4108. +        libdir=
  4109. +        if test -f "$lib"; then
  4110. +          # If there is no directory component, then add one.
  4111. +          case "$lib" in
  4112. +          */* | *\\*) . $lib ;;
  4113. +          *) . ./$lib ;;
  4114. +          esac
  4115. +        fi
  4116. +        libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
  4117. +        if test -n "$libdir" && test ! -f "$libfile"; then
  4118. +          $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  4119. +          finalize=no
  4120. +        fi
  4121. +      done
  4122. +
  4123. +      outputname=
  4124. +      if test "$fast_install" = no && test -n "$relink_command"; then
  4125. +        if test "$finalize" = yes && test -z "$run"; then
  4126. +          tmpdir="/tmp"
  4127. +          test -n "$TMPDIR" && tmpdir="$TMPDIR"
  4128. +          tmpdir="$tmpdir/libtool-$$"
  4129. +          if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
  4130. +          else
  4131. +        $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
  4132. +        continue
  4133. +          fi
  4134. +          outputname="$tmpdir/$file"
  4135. +          # Replace the output file specification.
  4136. +          relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  4137. +
  4138. +          $show "$relink_command"
  4139. +          if $run eval "$relink_command"; then :
  4140. +          else
  4141. +        $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  4142. +        ${rm}r "$tmpdir"
  4143. +        continue
  4144. +          fi
  4145. +          file="$outputname"
  4146. +        else
  4147. +          $echo "$modename: warning: cannot relink \`$file'" 1>&2
  4148. +        fi
  4149. +      else
  4150. +        # Install the binary that we compiled earlier.
  4151.          file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  4152. -          fi
  4153. -        fi
  4154. +      fi
  4155. +    fi
  4156.  
  4157. -        $show "$install_prog$stripme $file $destfile"
  4158. -        $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  4159. -        ;;
  4160. +    $show "$install_prog$stripme $file $destfile"
  4161. +    $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  4162. +    test -n "$outputname" && ${rm}r "$tmpdir"
  4163. +    ;;
  4164.        esac
  4165.      done
  4166.  
  4167. @@ -2575,9 +3379,9 @@
  4168.        eval cmds=\"$old_postinstall_cmds\"
  4169.        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  4170.        for cmd in $cmds; do
  4171. -        IFS="$save_ifs"
  4172. -        $show "$cmd"
  4173. -        $run eval "$cmd" || exit $?
  4174. +    IFS="$save_ifs"
  4175. +    $show "$cmd"
  4176. +    $run eval "$cmd" || exit $?
  4177.        done
  4178.        IFS="$save_ifs"
  4179.      done
  4180. @@ -2605,7 +3409,7 @@
  4181.      if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  4182.        for dir
  4183.        do
  4184. -        libdirs="$libdirs $dir"
  4185. +    libdirs="$libdirs $dir"
  4186.        done
  4187.  
  4188.        for libdir in $libdirs; do
  4189. @@ -2612,14 +3416,14 @@
  4190.      if test -n "$finish_cmds"; then
  4191.        # Do each command in the finish commands.
  4192.        eval cmds=\"$finish_cmds\"
  4193. -          IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  4194. -          for cmd in $cmds; do
  4195. -            IFS="$save_ifs"
  4196. -            $show "$cmd"
  4197. -            $run eval "$cmd" || admincmds="$admincmds
  4198. +      IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  4199. +      for cmd in $cmds; do
  4200. +        IFS="$save_ifs"
  4201. +        $show "$cmd"
  4202. +        $run eval "$cmd" || admincmds="$admincmds
  4203.         $cmd"
  4204. -          done
  4205. -          IFS="$save_ifs"
  4206. +      done
  4207. +      IFS="$save_ifs"
  4208.      fi
  4209.      if test -n "$finish_eval"; then
  4210.        # Do the single finish_eval.
  4211. @@ -2639,10 +3443,10 @@
  4212.        echo "   $libdir"
  4213.      done
  4214.      echo
  4215. -    echo "To link against installed libraries in a given directory, LIBDIR,"
  4216. -    echo "you must use the \`-LLIBDIR' flag during linking."
  4217. -    echo
  4218. -    echo " You will also need to do at least one of the following:"
  4219. +    echo "If you ever happen to want to link against installed libraries"
  4220. +    echo "in a given directory, LIBDIR, you must either use libtool, and"
  4221. +    echo "specify the full pathname of the library, or use \`-LLIBDIR'"
  4222. +    echo "flag during linking and do at least one of the following:"
  4223.      if test -n "$shlibpath_var"; then
  4224.        echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
  4225.        echo "     during execution"
  4226. @@ -2693,22 +3497,22 @@
  4227.        dir=
  4228.        case "$file" in
  4229.        *.la)
  4230. -        # Check to see that this really is a libtool archive.
  4231. -        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  4232. -        else
  4233. -          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  4234. -          $echo "$help" 1>&2
  4235. -          exit 1
  4236. -        fi
  4237. +    # Check to see that this really is a libtool archive.
  4238. +    if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  4239. +    else
  4240. +      $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  4241. +      $echo "$help" 1>&2
  4242. +      exit 1
  4243. +    fi
  4244.  
  4245.      # Read the libtool library.
  4246.      dlname=
  4247.      library_names=
  4248.  
  4249. -        # If there is no directory component, then add one.
  4250. +    # If there is no directory component, then add one.
  4251.      case "$file" in
  4252.      */* | *\\*) . $file ;;
  4253. -        *) . ./$file ;;
  4254. +    *) . ./$file ;;
  4255.      esac
  4256.  
  4257.      # Skip this library if it cannot be dlopened.
  4258. @@ -2737,7 +3541,7 @@
  4259.  
  4260.        *)
  4261.      $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  4262. -        continue
  4263. +    continue
  4264.      ;;
  4265.        esac
  4266.  
  4267. @@ -2764,8 +3568,8 @@
  4268.        case "$file" in
  4269.        -*) ;;
  4270.        *)
  4271. -        # Do a test to see if this is really a libtool program.
  4272. -        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4273. +    # Do a test to see if this is really a libtool program.
  4274. +    if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4275.        # If there is no directory component, then add one.
  4276.        case "$file" in
  4277.        */* | *\\*) . $file ;;
  4278. @@ -2775,7 +3579,7 @@
  4279.        # Transform arg to wrapped name.
  4280.        file="$progdir/$program"
  4281.      fi
  4282. -        ;;
  4283. +    ;;
  4284.        esac
  4285.        # Quote arguments (to preserve shell metacharacters).
  4286.        file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  4287. @@ -2788,10 +3592,10 @@
  4288.  
  4289.        # Restore saved enviroment variables
  4290.        if test "${save_LC_ALL+set}" = set; then
  4291. -        LC_ALL="$save_LC_ALL"; export LC_ALL
  4292. +    LC_ALL="$save_LC_ALL"; export LC_ALL
  4293.        fi
  4294.        if test "${save_LANG+set}" = set; then
  4295. -        LANG="$save_LANG"; export LANG
  4296. +    LANG="$save_LANG"; export LANG
  4297.        fi
  4298.  
  4299.        # Now actually exec the command.
  4300. @@ -2837,17 +3641,17 @@
  4301.  
  4302.        case "$name" in
  4303.        *.la)
  4304. -        # Possibly a libtool archive, so verify it.
  4305. -        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4306. -          . $dir/$name
  4307. -
  4308. -          # Delete the libtool libraries and symlinks.
  4309. -          for n in $library_names; do
  4310. -            rmfiles="$rmfiles $dir/$n"
  4311. -            test "X$n" = "X$dlname" && dlname=
  4312. -          done
  4313. -          test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
  4314. -          test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
  4315. +    # Possibly a libtool archive, so verify it.
  4316. +    if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4317. +      . $dir/$name
  4318. +
  4319. +      # Delete the libtool libraries and symlinks.
  4320. +      for n in $library_names; do
  4321. +        rmfiles="$rmfiles $dir/$n"
  4322. +        test "X$n" = "X$dlname" && dlname=
  4323. +      done
  4324. +      test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
  4325. +      test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
  4326.  
  4327.        $show "$rm $rmfiles"
  4328.        $run $rm $rmfiles
  4329. @@ -2864,7 +3668,7 @@
  4330.          IFS="$save_ifs"
  4331.        fi
  4332.  
  4333. -          if test -n "$old_library"; then
  4334. +      if test -n "$old_library"; then
  4335.          # Do each command in the old_postuninstall commands.
  4336.          eval cmds=\"$old_postuninstall_cmds\"
  4337.          IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  4338. @@ -2876,21 +3680,21 @@
  4339.          IFS="$save_ifs"
  4340.        fi
  4341.  
  4342. -          # FIXME: should reinstall the best remaining shared library.
  4343. -        fi
  4344. -        ;;
  4345. +      # FIXME: should reinstall the best remaining shared library.
  4346. +    fi
  4347. +    ;;
  4348.  
  4349.        *.lo)
  4350. -        if test "$build_old_libs" = yes; then
  4351. -          oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
  4352. -          rmfiles="$rmfiles $dir/$oldobj"
  4353. -        fi
  4354. +    if test "$build_old_libs" = yes; then
  4355. +      oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
  4356. +      rmfiles="$rmfiles $dir/$oldobj"
  4357. +    fi
  4358.      $show "$rm $rmfiles"
  4359.      $run $rm $rmfiles
  4360. -        ;;
  4361. +    ;;
  4362.  
  4363.        *)
  4364. -          $show "$rm $rmfiles"
  4365. +    $show "$rm $rmfiles"
  4366.      $run $rm $rmfiles
  4367.      ;;
  4368.        esac
  4369. @@ -2950,6 +3754,7 @@
  4370.  
  4371.  This mode accepts the following additional options:
  4372.  
  4373. +  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
  4374.    -static           always build a \`.o' file suitable for static linking
  4375.  
  4376.  COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  4377. @@ -3018,18 +3823,25 @@
  4378.  The following components of LINK-COMMAND are treated specially:
  4379.  
  4380.    -all-static       do not do any dynamic linking at all
  4381. +  -avoid-version    do not add a version suffix if possible
  4382.    -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
  4383. -  -dlpreopen FILE   link in FILE and add its symbols to dld_preloaded_symbols
  4384. +  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
  4385.    -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  4386. +  -export-symbols SYMFILE
  4387. +            try to export only the symbols listed in SYMFILE
  4388. +  -export-symbols-regex REGEX
  4389. +            try to export only the symbols matching REGEX
  4390.    -LLIBDIR          search LIBDIR for required installed libraries
  4391.    -lNAME            OUTPUT-FILE requires the installed library libNAME
  4392. +  -module           build a library that can dlopened
  4393.    -no-undefined     declare that a library does not refer to external symbols
  4394.    -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
  4395.    -release RELEASE  specify package release information
  4396.    -rpath LIBDIR     the created library will eventually be installed in LIBDIR
  4397. +  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
  4398.    -static           do not do any dynamic linking of libtool libraries
  4399.    -version-info CURRENT[:REVISION[:AGE]]
  4400. -                    specify library version info [each variable defaults to 0]
  4401. +            specify library version info [each variable defaults to 0]
  4402.  
  4403.  All other options (arguments beginning with \`-') are ignored.
  4404.  
  4405. @@ -3037,8 +3849,9 @@
  4406.  treated as uninstalled libtool libraries, other files are standard or library
  4407.  object files.
  4408.  
  4409. -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
  4410. -library objects (\`.lo' files) may be specified, and \`-rpath' is required.
  4411. +If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  4412. +only library objects (\`.lo' files) may be specified, and \`-rpath' is
  4413. +required, except when creating a convenience library.
  4414.  
  4415.  If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  4416.  using \`ar' and \`ranlib', or on Windows using \`lib'.
  4417. @@ -3048,7 +3861,7 @@
  4418.    ;;
  4419.  
  4420.  uninstall)
  4421. -  $echo
  4422. +  $echo \
  4423.  "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  4424.  
  4425.  Remove libraries from an installation directory.
  4426. --- ./ltconfig    Mon Mar  1 16:52:03 1999
  4427. +++ ../libgtop-1.0.1/./ltconfig    Wed May  5 11:57:02 1999
  4428. @@ -1,8 +1,8 @@
  4429.  #! /bin/sh
  4430.  
  4431.  # ltconfig - Create a system-specific libtool.
  4432. -# Copyright (C) 1996-1998 Free Software Foundation, Inc.
  4433. -# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  4434. +# Copyright (C) 1996-1999 Free Software Foundation, Inc.
  4435. +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  4436.  #
  4437.  # This file is free software; you can redistribute it and/or modify it
  4438.  # under the terms of the GNU General Public License as published by
  4439. @@ -32,12 +32,8 @@
  4440.    # Discard the --no-reexec flag, and continue.
  4441.    shift
  4442.  elif test "X$1" = X--fallback-echo; then
  4443. -  # used as fallback echo
  4444. -  shift
  4445. -  cat <<EOF
  4446. -$*
  4447. -EOF
  4448. -  exit 0
  4449. +  # Avoid inline document here, it may be left over
  4450. +  :
  4451.  elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  4452.    # Yippee, $echo works!
  4453.    :
  4454. @@ -46,6 +42,25 @@
  4455.    exec "$SHELL" "$0" --no-reexec ${1+"$@"}
  4456.  fi
  4457.  
  4458. +if test "X$1" = X--fallback-echo; then
  4459. +  # used as fallback echo
  4460. +  shift
  4461. +  cat <<EOF
  4462. +$*
  4463. +EOF
  4464. +  exit 0
  4465. +fi
  4466. +
  4467. +# Find the correct PATH separator.  Usually this is `:', but
  4468. +# DJGPP uses `;' like DOS.
  4469. +if test "X${PATH_SEPARATOR+set}" != "Xset"; then
  4470. +  UNAME=${UNAME-`uname 2>/dev/null`}
  4471. +  case X$UNAME in
  4472. +    *-DOS) PATH_SEPARATOR=';' ;;
  4473. +    *)     PATH_SEPARATOR=':' ;;
  4474. +  esac
  4475. +fi
  4476. +
  4477.  # The HP-UX ksh and POSIX shell print the target directory to stdout
  4478.  # if CDPATH is set.
  4479.  if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  4480. @@ -70,9 +85,9 @@
  4481.    #
  4482.    # So, first we look for a working echo in the user's PATH.
  4483.  
  4484. -  IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  4485. +  IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  4486.    for dir in $PATH /usr/ucb; do
  4487. -    if test -f $dir/echo &&
  4488. +    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
  4489.         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  4490.         test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4491.        echo="$dir/echo"
  4492. @@ -87,7 +102,8 @@
  4493.         test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4494.        # This shell has a builtin print -r that does the trick.
  4495.        echo='print -r'
  4496. -    elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then
  4497. +    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
  4498. +     test "X$CONFIG_SHELL" != X/bin/ksh; then
  4499.        # If we have ksh, try running ltconfig again with it.
  4500.        ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
  4501.        export ORIGINAL_CONFIG_SHELL
  4502. @@ -96,10 +112,10 @@
  4503.        exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
  4504.      else
  4505.        # Try using printf.
  4506. -      echo='printf %s\n'
  4507. +      echo='printf "%s\n"'
  4508.        if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  4509. -         test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4510. -        # Cool, printf works
  4511. +     test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4512. +    # Cool, printf works
  4513.      :
  4514.        elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
  4515.         test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4516. @@ -110,9 +126,9 @@
  4517.      echo="$CONFIG_SHELL $0 --fallback-echo"
  4518.        elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
  4519.         test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4520. -        echo="$CONFIG_SHELL $0 --fallback-echo"
  4521. +    echo="$CONFIG_SHELL $0 --fallback-echo"
  4522.        else
  4523. -        # maybe with a smaller string...
  4524. +    # maybe with a smaller string...
  4525.      prev=:
  4526.  
  4527.      for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
  4528. @@ -143,6 +159,10 @@
  4529.  # Same as above, but do not quote variable references.
  4530.  double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
  4531.  
  4532. +# Sed substitution to delay expansion of an escaped shell variable in a
  4533. +# double_quote_subst'ed string.
  4534. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
  4535. +
  4536.  # The name of this program.
  4537.  progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
  4538.  
  4539. @@ -149,7 +169,8 @@
  4540.  # Constants:
  4541.  PROGRAM=ltconfig
  4542.  PACKAGE=libtool
  4543. -VERSION=1.2d
  4544. +VERSION=1.3
  4545. +TIMESTAMP=" (1.385.2.117 1999/04/29 13:07:13)"
  4546.  ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
  4547.  ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
  4548.  rm="rm -f"
  4549. @@ -162,6 +183,9 @@
  4550.  enable_shared=yes
  4551.  # All known linkers require a `.a' archive for static linking.
  4552.  enable_static=yes
  4553. +enable_fast_install=yes
  4554. +enable_dlopen=unknown
  4555. +enable_win32_dll=no
  4556.  ltmain=
  4557.  silent=
  4558.  srcdir=
  4559. @@ -174,18 +198,23 @@
  4560.  with_gcc=no
  4561.  with_gnu_ld=no
  4562.  need_locks=yes
  4563. +ac_ext=c
  4564.  objext=o
  4565.  libext=a
  4566. +cache_file=
  4567.  
  4568.  old_AR="$AR"
  4569.  old_CC="$CC"
  4570.  old_CFLAGS="$CFLAGS"
  4571.  old_CPPFLAGS="$CPPFLAGS"
  4572. +old_LDFLAGS="$LDFLAGS"
  4573.  old_LD="$LD"
  4574.  old_LN_S="$LN_S"
  4575. +old_LIBS="$LIBS"
  4576.  old_NM="$NM"
  4577.  old_RANLIB="$RANLIB"
  4578.  old_DLLTOOL="$DLLTOOL"
  4579. +old_OBJDUMP="$OBJDUMP"
  4580.  old_AS="$AS"
  4581.  
  4582.  # Parse the command line options.
  4583. @@ -214,6 +243,9 @@
  4584.      --debug                enable verbose shell tracing
  4585.      --disable-shared       do not build shared libraries
  4586.      --disable-static       do not build static libraries
  4587. +    --disable-fast-install do not optimize for fast installation
  4588. +    --enable-dlopen        enable dlopen support
  4589. +    --enable-win32-dll     enable building dlls on win32 hosts
  4590.      --help                 display this help and exit
  4591.      --no-verify            do not verify that HOST is a valid host type
  4592.  -o, --output=FILE          specify the output file [default=$default_ofile]
  4593. @@ -224,6 +256,7 @@
  4594.      --with-gcc             assume that the GNU C compiler will be used
  4595.      --with-gnu-ld          assume that the C compiler uses the GNU linker
  4596.      --disable-lock         disable file locking
  4597. +    --cache-file=FILE      configure cache file
  4598.  
  4599.  LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
  4600.  that provides basic libtool functionality.
  4601. @@ -242,6 +275,12 @@
  4602.  
  4603.    --disable-static) enable_static=no ;;
  4604.  
  4605. +  --disable-fast-install) enable_fast_install=no ;;
  4606. +
  4607. +  --enable-dlopen) enable_dlopen=yes ;;
  4608. +
  4609. +  --enable-win32-dll) enable_win32_dll=yes ;;
  4610. +
  4611.    --quiet | --silent) silent=yes ;;
  4612.  
  4613.    --srcdir) prev=srcdir ;;
  4614. @@ -252,7 +291,7 @@
  4615.    --output | -o) prev=ofile ;;
  4616.    --output=*) ofile="$optarg" ;;
  4617.  
  4618. -  --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
  4619. +  --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
  4620.  
  4621.    --with-gcc) with_gcc=yes ;;
  4622.    --with-gnu-ld) with_gnu_ld=yes ;;
  4623. @@ -259,6 +298,8 @@
  4624.  
  4625.    --disable-lock) need_locks=no ;;
  4626.  
  4627. +  --cache-file=*) cache_file="$optarg" ;;
  4628. +
  4629.    -*)
  4630.      echo "$progname: unrecognized option \`$option'" 1>&2
  4631.      echo "$help" 1>&2
  4632. @@ -329,6 +370,11 @@
  4633.  if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  4634.  if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
  4635.  
  4636. +if test -n "$cache_file" && test -r "$cache_file"; then
  4637. +  echo "loading cache $cache_file within ltconfig"
  4638. +  . $cache_file
  4639. +fi
  4640. +
  4641.  if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  4642.    # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  4643.    if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  4644. @@ -343,7 +389,7 @@
  4645.  
  4646.  if test -z "$srcdir"; then
  4647.    # Assume the source directory is the same one as the path to LTMAIN.
  4648. -  srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
  4649. +  srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
  4650.    test "$srcdir" = "$ltmain" && srcdir=.
  4651.  fi
  4652.  
  4653. @@ -429,15 +475,18 @@
  4654.  # Set a sane default for `AR'.
  4655.  test -z "$AR" && AR=ar
  4656.  
  4657. +# Set a sane default for `OBJDUMP'.
  4658. +test -z "$OBJDUMP" && OBJDUMP=objdump
  4659. +
  4660.  # If RANLIB is not set, then run the test.
  4661.  if test "${RANLIB+set}" != "set"; then
  4662.    result=no
  4663.  
  4664.    echo $ac_n "checking for ranlib... $ac_c" 1>&6
  4665. -  IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  4666. +  IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  4667.    for dir in $PATH; do
  4668.      test -z "$dir" && dir=.
  4669. -    if test -f $dir/ranlib; then
  4670. +    if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then
  4671.        RANLIB="ranlib"
  4672.        result="ranlib"
  4673.        break
  4674. @@ -453,8 +502,9 @@
  4675.    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
  4676.  fi
  4677.  
  4678. -# Set sane defaults for `DLLTOOL' and `AS', used on cygwin32.
  4679. +# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin.
  4680.  test -z "$DLLTOOL" && DLLTOOL=dlltool
  4681. +test -z "$OBJDUMP" && OBJDUMP=objdump
  4682.  test -z "$AS" && AS=as
  4683.  
  4684.  # Check to see if we are using GCC.
  4685. @@ -462,11 +512,10 @@
  4686.    # If CC is not set, then try to find GCC or a usable CC.
  4687.    if test -z "$CC"; then
  4688.      echo $ac_n "checking for gcc... $ac_c" 1>&6
  4689. -    IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  4690. +    IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  4691.      for dir in $PATH; do
  4692. -      IFS="$save_ifs"
  4693.        test -z "$dir" && dir=.
  4694. -      if test -f $dir/gcc; then
  4695. +      if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then
  4696.      CC="gcc"
  4697.      break
  4698.        fi
  4699. @@ -483,11 +532,11 @@
  4700.    # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
  4701.    if test -z "$CC"; then
  4702.      echo $ac_n "checking for cc... $ac_c" 1>&6
  4703. -    IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  4704. +    IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  4705.      cc_rejected=no
  4706.      for dir in $PATH; do
  4707.        test -z "$dir" && dir=.
  4708. -      if test -f $dir/cc; then
  4709. +      if test -f $dir/cc || test -f $dir/cc$ac_exeext; then
  4710.      if test "$dir/cc" = "/usr/ucb/cc"; then
  4711.        cc_rejected=yes
  4712.        continue
  4713. @@ -527,7 +576,7 @@
  4714.    # Now see if the compiler is really GCC.
  4715.    with_gcc=no
  4716.    echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
  4717. -  echo "$progname:530: checking whether we are using GNU C" >&5
  4718. +  echo "$progname:579: checking whether we are using GNU C" >&5
  4719.  
  4720.    $rm conftest.c
  4721.    cat > conftest.c <<EOF
  4722. @@ -535,7 +584,7 @@
  4723.    yes;
  4724.  #endif
  4725.  EOF
  4726. -  if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  4727. +  if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  4728.      with_gcc=yes
  4729.    fi
  4730.    $rm conftest.c
  4731. @@ -549,8 +598,8 @@
  4732.  echo $ac_n "checking for object suffix... $ac_c" 1>&6
  4733.  $rm conftest*
  4734.  echo 'int i = 1;' > conftest.c
  4735. -echo "$progname:552: checking for object suffix" >& 5
  4736. -if { (eval echo $progname:553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
  4737. +echo "$progname:601: checking for object suffix" >& 5
  4738. +if { (eval echo $progname:602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
  4739.    # Append any warnings to the config.log.
  4740.    cat conftest.err 1>&5
  4741.  
  4742. @@ -580,10 +629,19 @@
  4743.    link_static_flag='-static'
  4744.  
  4745.    case "$host_os" in
  4746. -  aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
  4747. +  beos* | irix5* | irix6* | osf3* | osf4*)
  4748.      # PIC is the default for these OSes.
  4749.      ;;
  4750. -  cygwin32* | mingw32* | os2*)
  4751. +  aix*)
  4752. +    # Below there is a dirty hack to force normal static linking with -ldl
  4753. +    # The problem is because libdl dynamically linked with both libc and
  4754. +    # libC (AIX C++ library), which obviously doesn't included in libraries
  4755. +    # list by gcc. This cause undefined symbols with -static flags.
  4756. +    # This hack allows C programs to be linked with "-static -ldl", but
  4757. +    # we not sure about C++ programs.
  4758. +    link_static_flag="$link_static_flag ${wl}-lC"
  4759. +    ;;
  4760. +  cygwin* | mingw* | os2*)
  4761.      # We can build DLLs from non-PIC.
  4762.      ;;
  4763.    amigaos*)
  4764. @@ -617,7 +675,7 @@
  4765.      # PIC (with -KPIC) is the default.
  4766.      ;;
  4767.  
  4768. -  cygwin32* | mingw32* | os2*)
  4769. +  cygwin* | mingw* | os2*)
  4770.      # We can build DLLs from non-PIC.
  4771.      ;;
  4772.  
  4773. @@ -645,7 +703,7 @@
  4774.      wl='-Qoption ld '
  4775.      ;;
  4776.  
  4777. -  sysv4.2uw2* | sysv5*)
  4778. +  sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  4779.      pic_flag='-KPIC'
  4780.      link_static_flag='-Bstatic'
  4781.      wl='-Wl,'
  4782. @@ -671,22 +729,30 @@
  4783.    echo "int some_variable = 0;" > conftest.c
  4784.    save_CFLAGS="$CFLAGS"
  4785.    CFLAGS="$CFLAGS $pic_flag -DPIC"
  4786. -  echo "$progname:674: checking if $compiler PIC flag $pic_flag works" >&5
  4787. -  if { (eval echo $progname:675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
  4788. +  echo "$progname:732: checking if $compiler PIC flag $pic_flag works" >&5
  4789. +  if { (eval echo $progname:733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
  4790.      # Append any warnings to the config.log.
  4791.      cat conftest.err 1>&5
  4792. -
  4793. -    # On HP-UX, both CC and GCC only warn that PIC is supported... then they
  4794. -    # create non-PIC objects.  So, if there were any warnings, we assume that
  4795. -    # PIC is not supported.
  4796. -    if test -s conftest.err; then
  4797. -      echo "$ac_t"no 1>&6
  4798. -      can_build_shared=no
  4799. -      pic_flag=
  4800. -    else
  4801. +    
  4802. +    case "$host_os" in
  4803. +    hpux9* | hpux10* | hpux11*)
  4804. +      # On HP-UX, both CC and GCC only warn that PIC is supported... then they
  4805. +      # create non-PIC objects.  So, if there were any warnings, we assume that
  4806. +      # PIC is not supported.
  4807. +      if test -s conftest.err; then
  4808. +    echo "$ac_t"no 1>&6
  4809. +    can_build_shared=no
  4810. +    pic_flag=
  4811. +      else
  4812. +    echo "$ac_t"yes 1>&6
  4813. +    pic_flag=" $pic_flag"
  4814. +      fi
  4815. +      ;;
  4816. +    *)
  4817.        echo "$ac_t"yes 1>&6
  4818.        pic_flag=" $pic_flag"
  4819. -    fi
  4820. +      ;;
  4821. +    esac
  4822.    else
  4823.      # Append any errors to the config.log.
  4824.      cat conftest.err 1>&5
  4825. @@ -702,16 +768,26 @@
  4826.  
  4827.  # Check to see if options -o and -c are simultaneously supported by compiler
  4828.  echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
  4829. +$rm -r conftest 2>/dev/null
  4830. +mkdir conftest
  4831. +cd conftest
  4832.  $rm conftest*
  4833.  echo "int some_variable = 0;" > conftest.c
  4834. +mkdir out
  4835. +# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
  4836. +# that will create temporary files in the current directory regardless of
  4837. +# the output directory.  Thus, making CWD read-only will cause this test
  4838. +# to fail, enabling locking or at least warning the user not to do parallel
  4839. +# builds.
  4840. +chmod -w .
  4841.  save_CFLAGS="$CFLAGS"
  4842. -CFLAGS="$CFLAGS -c -o conftest2.o"
  4843. -echo "$progname:709: checking if $compiler supports -c -o file.o" >&5
  4844. -if { (eval echo $progname:710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then
  4845. +CFLAGS="$CFLAGS -o out/conftest2.o"
  4846. +echo "$progname:785: checking if $compiler supports -c -o file.o" >&5
  4847. +if { (eval echo $progname:786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
  4848.  
  4849.    # The compiler can only warn and ignore the option if not recognized
  4850.    # So say no if there are warnings
  4851. -    if test -s conftest.err; then
  4852. +    if test -s out/conftest.err; then
  4853.        echo "$ac_t"no 1>&6
  4854.        compiler_c_o=no
  4855.      else
  4856. @@ -720,12 +796,17 @@
  4857.      fi
  4858.  else
  4859.    # Append any errors to the config.log.
  4860. -  cat conftest.err 1>&5
  4861. +  cat out/conftest.err 1>&5
  4862.    compiler_c_o=no
  4863.    echo "$ac_t"no 1>&6
  4864.  fi
  4865.  CFLAGS="$save_CFLAGS"
  4866. -$rm conftest*
  4867. +chmod u+w .
  4868. +$rm conftest* out/*
  4869. +rmdir out
  4870. +cd ..
  4871. +rmdir conftest
  4872. +$rm -r conftest 2>/dev/null
  4873.  
  4874.  if test x"$compiler_c_o" = x"yes"; then
  4875.    # Check to see if we can write to a .lo
  4876. @@ -734,8 +815,8 @@
  4877.    echo "int some_variable = 0;" > conftest.c
  4878.    save_CFLAGS="$CFLAGS"
  4879.    CFLAGS="$CFLAGS -c -o conftest.lo"
  4880. -  echo "$progname:737: checking if $compiler supports -c -o file.lo" >&5
  4881. -if { (eval echo $progname:738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
  4882. +  echo "$progname:818: checking if $compiler supports -c -o file.lo" >&5
  4883. +if { (eval echo $progname:819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
  4884.  
  4885.      # The compiler can only warn and ignore the option if not recognized
  4886.      # So say no if there are warnings
  4887. @@ -743,8 +824,8 @@
  4888.      echo "$ac_t"no 1>&6
  4889.      compiler_o_lo=no
  4890.        else
  4891. -        echo "$ac_t"yes 1>&6
  4892. -        compiler_o_lo=yes
  4893. +    echo "$ac_t"yes 1>&6
  4894. +    compiler_o_lo=yes
  4895.        fi
  4896.    else
  4897.      # Append any errors to the config.log.
  4898. @@ -786,17 +867,17 @@
  4899.    echo "int some_variable = 0;" > conftest.c
  4900.    save_CFLAGS="$CFLAGS"
  4901.    CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
  4902. -  echo "$progname:789: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
  4903. -  if { (eval echo $progname:790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  4904. +  echo "$progname:870: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
  4905. +  if { (eval echo $progname:871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  4906.  
  4907.      # The compiler can only warn and ignore the option if not recognized
  4908.      # So say no if there are warnings
  4909.        if test -s conftest.err; then
  4910. -        echo "$ac_t"no 1>&6
  4911. -        compiler_rtti_exceptions=no
  4912. +    echo "$ac_t"no 1>&6
  4913. +    compiler_rtti_exceptions=no
  4914.        else
  4915. -        echo "$ac_t"yes 1>&6
  4916. -        compiler_rtti_exceptions=yes
  4917. +    echo "$ac_t"yes 1>&6
  4918. +    compiler_rtti_exceptions=yes
  4919.        fi
  4920.    else
  4921.      # Append any errors to the config.log.
  4922. @@ -830,8 +911,8 @@
  4923.  echo 'main(){return(0);}' > conftest.c
  4924.  save_LDFLAGS="$LDFLAGS"
  4925.  LDFLAGS="$LDFLAGS $link_static_flag"
  4926. -echo "$progname:833: checking if $compiler static flag $link_static_flag works" >&5
  4927. -if { (eval echo $progname:834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  4928. +echo "$progname:914: checking if $compiler static flag $link_static_flag works" >&5
  4929. +if { (eval echo $progname:915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  4930.    echo "$ac_t$link_static_flag" 1>&6
  4931.  else
  4932.    echo "$ac_t"none 1>&6
  4933. @@ -843,9 +924,9 @@
  4934.  if test -z "$LN_S"; then
  4935.    # Check to see if we can use ln -s, or we need hard links.
  4936.    echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
  4937. -  $rm conftestdata
  4938. -  if ln -s X conftestdata 2>/dev/null; then
  4939. -    $rm conftestdata
  4940. +  $rm conftest.dat
  4941. +  if ln -s X conftest.dat 2>/dev/null; then
  4942. +    $rm conftest.dat
  4943.      LN_S="ln -s"
  4944.    else
  4945.      LN_S=ln
  4946. @@ -863,48 +944,18 @@
  4947.    if test "$with_gcc" = yes; then
  4948.      # Check if gcc -print-prog-name=ld gives a path.
  4949.      echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
  4950. -    echo "$progname:866: checking for ld used by GCC" >&5
  4951. +    echo "$progname:947: checking for ld used by GCC" >&5
  4952.      ac_prog=`($CC -print-prog-name=ld) 2>&5`
  4953.      case "$ac_prog" in
  4954.      # Accept absolute paths.
  4955. -    /* | [A-Za-z]:/*)
  4956. +    [\\/]* | [A-Za-z]:[\\/]*)
  4957.        re_direlt='/[^/][^/]*/\.\./'
  4958. -      sub_uncdrive='s%^\([A-Za-z]\):/%//\1/%'
  4959. -      # Canonicalize the path of ld
  4960. -      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  4961. -        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  4962. -      done
  4963. -      case "$host_os" in
  4964. -      cygwin*)
  4965. -        # Convert to a UNC path for cygwin
  4966. -        test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive"`
  4967. -    ;;
  4968. -      *)
  4969. -        test -z "$LD" && LD="$ac_prog"
  4970. -    ;;
  4971. -      esac
  4972. -      ;;
  4973. -    ##
  4974. -    ## FIXME:  The code fails later on if we try to use an $LD with
  4975. -    ##         '\\' path separators.
  4976. -    ##
  4977. -    [A-Za-z]:[\\]*)
  4978. -      re_direlt='\\[^\\][^\\]*\\\.\.\(\\\)'
  4979. -      sub_uncdrive='s%^\([A-Za-z]\):\\%//\1/%'
  4980. -      sub_uncdir='s%\\%/%g'
  4981.        # Canonicalize the path of ld
  4982. +      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  4983.        while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  4984. -        ac_prog=`echo $ac_prog| sed "s%$re_direlt%\1%"`
  4985. +    ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  4986.        done
  4987. -      case "$host_os" in
  4988. -      cygwin*)
  4989. -        # Convert to a UNC path for cygwin
  4990. -        test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive" -e "$sub_uncdir"`
  4991. -    ;;
  4992. -      *)
  4993. -        test -z "$LD" && LD="$ac_prog"
  4994. -    ;;
  4995. -      esac
  4996. +      test -z "$LD" && LD="$ac_prog"
  4997.        ;;
  4998.      "")
  4999.        # If it fails, then pretend we are not using GCC.
  5000. @@ -917,17 +968,17 @@
  5001.      esac
  5002.    elif test "$with_gnu_ld" = yes; then
  5003.      echo $ac_n "checking for GNU ld... $ac_c" 1>&6
  5004. -    echo "$progname:920: checking for GNU ld" >&5
  5005. +    echo "$progname:971: checking for GNU ld" >&5
  5006.    else
  5007.      echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
  5008. -    echo "$progname:923: checking for non-GNU ld" >&5
  5009. +    echo "$progname:974: checking for non-GNU ld" >&5
  5010.    fi
  5011.  
  5012.    if test -z "$LD"; then
  5013. -    IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  5014. +    IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  5015.      for ac_dir in $PATH; do
  5016.        test -z "$ac_dir" && ac_dir=.
  5017. -      if test -f "$ac_dir/$ac_prog"; then
  5018. +      if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  5019.      LD="$ac_dir/$ac_prog"
  5020.      # Check to see if the program is GNU ld.  I'd rather use --version,
  5021.      # but apparently some GNU ld's only accept -v.
  5022. @@ -969,11 +1020,16 @@
  5023.  
  5024.  allow_undefined_flag=
  5025.  no_undefined_flag=
  5026. +need_lib_prefix=unknown
  5027. +need_version=unknown
  5028. +# when you set need_version to no, make sure it does not cause -set_version
  5029. +# flags to be left without arguments
  5030.  archive_cmds=
  5031. -archive_sym_cmds=
  5032. +archive_expsym_cmds=
  5033.  old_archive_from_new_cmds=
  5034.  export_dynamic_flag_spec=
  5035.  whole_archive_flag_spec=
  5036. +thread_safe_flag_spec=
  5037.  hardcode_libdir_flag_spec=
  5038.  hardcode_libdir_separator=
  5039.  hardcode_direct=no
  5040. @@ -980,99 +1036,132 @@
  5041.  hardcode_minus_L=no
  5042.  hardcode_shlibpath_var=unsupported
  5043.  runpath_var=
  5044. +always_export_symbols=no
  5045. +export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
  5046. +# include_expsyms should be a list of space-separated symbols to be *always*
  5047. +# included in the symbol list
  5048. +include_expsyms=
  5049. +# exclude_expsyms can be an egrep regular expression of symbols to exclude
  5050. +# it will be wrapped by ` (' and `)$', so one must not match beginning or
  5051. +# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
  5052. +# as well as any symbol that contains `d'.
  5053. +exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
  5054. +# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
  5055. +# platforms (ab)use it in PIC code, but their linkers get confused if
  5056. +# the symbol is explicitly referenced.  Since portable code cannot
  5057. +# rely on this symbol name, it's probably fine to never include it in
  5058. +# preloaded symbol tables.
  5059.  
  5060.  case "$host_os" in
  5061. -aix3* | aix4*)
  5062. -  # On AIX, the GNU linker works like the native linker.
  5063. -  with_gnu_ld=no
  5064. +cygwin* | mingw*)
  5065. +  # FIXME: the MSVC++ port hasn't been tested in a loooong time
  5066. +  # When not using gcc, we currently assume that we are using
  5067. +  # Microsoft Visual C++.
  5068. +  if test "$with_gcc" != yes; then
  5069. +    with_gnu_ld=no
  5070. +  fi
  5071.    ;;
  5072. +
  5073.  esac
  5074.  
  5075.  ld_shlibs=yes
  5076.  if test "$with_gnu_ld" = yes; then
  5077. +  # If archive_cmds runs LD, not CC, wlarc should be empty
  5078. +  wlarc='${wl}'
  5079.  
  5080.    # See if GNU ld supports shared libraries.
  5081.    case "$host_os" in
  5082. +  aix3* | aix4*)
  5083. +    # On AIX, the GNU linker is very broken
  5084. +    ld_shlibs=no
  5085. +    cat <<EOF 1>&2
  5086. +
  5087. +*** Warning: the GNU linker, at least up to release 2.9.1, is reported
  5088. +*** to be unable to reliably create shared libraries on AIX.
  5089. +*** Therefore, libtool is disabling shared libraries support.  If you
  5090. +*** really care for shared libraries, you may want to modify your PATH
  5091. +*** so that a non-GNU linker is found, and then restart.
  5092. +
  5093. +EOF
  5094. +    ;;
  5095. +
  5096.    amigaos*)
  5097. -    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib$libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  5098. +    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  5099.      hardcode_libdir_flag_spec='-L$libdir'
  5100.      hardcode_minus_L=yes
  5101. -    ;;
  5102.  
  5103. -  sunos4*)
  5104. -    archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs$deplibs'
  5105. -    hardcode_direct=yes
  5106. -    hardcode_minus_L=yes
  5107. -    hardcode_shlibpath_var=no
  5108. +    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
  5109. +    # that the semantics of dynamic libraries on AmigaOS, at least up
  5110. +    # to version 4, is to share data among multiple programs linked
  5111. +    # with the same dynamic library.  Since this doesn't match the
  5112. +    # behavior of shared libraries on other platforms, we can use
  5113. +    # them.
  5114. +    ld_shlibs=no
  5115.      ;;
  5116.  
  5117. -  cygwin32* | mingw32*)
  5118. -    if test "$with_gcc" = yes; then
  5119. -      # hardcode_libdir_flag_spec is actually meaningless, as there is
  5120. -      # no search path for DLLs.
  5121. -      hardcode_libdir_flag_spec='-L$libdir'
  5122. +  beos*)
  5123. +    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  5124.        allow_undefined_flag=unsupported
  5125. -      # Very, very bogus.
  5126. -      echo '
  5127. -#define WIN32_LEAN_AND_MEAN
  5128. -#include <windows.h>
  5129. -#undef WIN32_LEAN_AND_MEAN
  5130. -#include <stdio.h>
  5131. +      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  5132. +      # support --undefined.  This deserves some investigation.  FIXME
  5133. +      archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  5134. +    else
  5135. +      ld_shlibs=no
  5136. +    fi
  5137. +    ;;
  5138.  
  5139. -BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
  5140. +  cygwin* | mingw*)
  5141. +    # hardcode_libdir_flag_spec is actually meaningless, as there is
  5142. +    # no search path for DLLs.
  5143. +    hardcode_libdir_flag_spec='-L$libdir'
  5144. +    allow_undefined_flag=unsupported
  5145. +    always_export_symbols=yes
  5146.  
  5147. -#include <cygwin/cygwin_dll.h>
  5148. -DECLARE_CYGWIN_DLL( DllMain );
  5149. -HINSTANCE __hDllInstance_base;
  5150. +    # Extract the symbol export list from an `--export-all' def file,
  5151. +    # then regenerate the def file from the symbol export list, so that
  5152. +    # the compiled dll only exports the symbol export list.
  5153. +    export_symbols_cmds='rm -f $objdir/$soname-ltdll.c~
  5154. +      sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
  5155. +      (cd $objdir && $CC -c $soname-ltdll.c)~
  5156. +      $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def  $objdir/$soname-ltdll.$objext $libobjs~
  5157. +      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
  5158. +
  5159. +    archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
  5160. +      _lt_hint=1;
  5161. +      for symbol in `cat $export_symbols`; do
  5162. +    echo "    \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
  5163. +    _lt_hint=`expr 1 + \$_lt_hint`;
  5164. +      done~
  5165. +      $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  5166. +      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  5167. +      $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  5168. +      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  5169. +      $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
  5170.  
  5171. -BOOL APIENTRY
  5172. -DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
  5173. -{
  5174. -  __hDllInstance_base = hInst;
  5175. -  return TRUE;
  5176. -}
  5177. -' > ltdll.c
  5178. -      archive_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~
  5179. -      $DLLTOOL --export-all --output-def $lib-def $libobjs ltdll.$objext~
  5180. -      $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~
  5181. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  5182. -      $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  5183. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  5184. -      $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  5185. -      $rm ltdll.$objext $soname-base $soname-exp'
  5186. -      archive_sym_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~
  5187. -      cat "$export_symbols" >> $lib-def~
  5188. -      $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~
  5189. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  5190. -      $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  5191. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  5192. -      $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  5193. -      $rm ltdll.$objext $soname-base $soname-exp'
  5194. -      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $lib-def --output-lib $objdir/$libname.a~$rm $lib.exp'
  5195. -   else
  5196. -      # When not using gcc, we currently assume that we are using
  5197. -      # Microsoft Visual C++.
  5198. -      with_gnu_ld=no
  5199. -      # hardcode_libdir_flag_spec is actually meaningless, as there is
  5200. -      # no search path for DLLs.
  5201. -      hardcode_libdir_flag_spec=' '
  5202. -      allow_undefined_flag=unsupported
  5203. -      # Tell ltmain to make .lib files, not .a files.
  5204. -      libext=lib
  5205. -      # FIXME: Setting linknames here is a bad hack.
  5206. -      archive_cmds='$CC -o $lib$libobjs`echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  5207. -      # The linker will automatically build a .lib file if we build a DLL.
  5208. -      old_archive_from_new_cmds='true'
  5209. -      # FIXME: Should let the user specify the lib program.
  5210. -      old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  5211. -      fix_srcfile_path='`cygpath -w $srcfile`'
  5212. +      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
  5213. +    ;;
  5214. +
  5215. +  netbsd*)
  5216. +    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  5217. +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  5218. +      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  5219. +    else
  5220. +      archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib'
  5221. +      # can we support soname and/or expsyms with a.out? -oliva
  5222.      fi
  5223.      ;;
  5224.  
  5225. +  sunos4*)
  5226. +    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts'
  5227. +    wlarc=
  5228. +    hardcode_direct=yes
  5229. +    hardcode_shlibpath_var=no
  5230. +    ;;
  5231. +
  5232.    *)
  5233.      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  5234. -      archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs$deplibs'
  5235. -      archive_sym_cmds='$CC -shared ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib$libobjs$deplibs'
  5236. +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  5237. +      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  5238.      else
  5239.        ld_shlibs=no
  5240.      fi
  5241. @@ -1079,11 +1168,11 @@
  5242.      ;;
  5243.    esac
  5244.  
  5245. -  if test "$ld_shlibs" = yes && test "$with_gnu_ld" = yes; then
  5246. +  if test "$ld_shlibs" = yes; then
  5247.      runpath_var=LD_RUN_PATH
  5248.      hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
  5249.      export_dynamic_flag_spec='${wl}--export-dynamic'
  5250. -    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
  5251. +    whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  5252.    fi
  5253.  else
  5254.    # PORTME fill in a description of your system's linker (not GNU ld)
  5255. @@ -1090,9 +1179,8 @@
  5256.    case "$host_os" in
  5257.    aix3*)
  5258.      allow_undefined_flag=unsupported
  5259. -    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~
  5260. -        $LD -o $objdir/$soname$libobjs$deplibs -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  5261. -    archive_sym_cmds='$LD -o $objdir/$soname$libobjs$deplibs -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  5262. +    always_export_symbols=yes
  5263. +    archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  5264.      # Note: this linker hardcodes the directories in LIBPATH if there
  5265.      # are no directories specified by -L.
  5266.      hardcode_minus_L=yes
  5267. @@ -1104,80 +1192,67 @@
  5268.      ;;
  5269.  
  5270.    aix4*)
  5271. -    allow_undefined_flag=unsupported
  5272. -    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp        else cat $export_symbols > $lib.exp~
  5273. -        $CC -o $objdir/$soname$libobjs$deplibs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry~$AR cru $lib $objdir/$soname'
  5274. -    archive_sym_cmds='$CC -o $objdir/$soname$libobjs$deplibs ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry~$AR cru $lib $objdir/$soname'
  5275. -    hardcode_direct=yes
  5276. -    hardcode_minus_L=yes
  5277. -    ;;
  5278. +    hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
  5279. +    hardcode_libdir_separator=':'
  5280. +    if test "$with_gcc" = yes; then
  5281. +      collect2name=`${CC} -print-prog-name=collect2`
  5282. +      if test -f "$collect2name" && \
  5283. +     strings "$collect2name" | grep resolve_lib_name >/dev/null
  5284. +      then
  5285. +    # We have reworked collect2
  5286. +    hardcode_direct=yes
  5287. +      else
  5288. +    # We have old collect2
  5289. +    hardcode_direct=unsupported
  5290. +    # It fails to find uninstalled libraries when the uninstalled
  5291. +    # path is not listed in the libpath.  Setting hardcode_minus_L
  5292. +    # to unsupported forces relinking
  5293. +    hardcode_minus_L=yes
  5294. +    hardcode_libdir_flag_spec='-L$libdir'
  5295. +    hardcode_libdir_separator=
  5296. +      fi
  5297. +      shared_flag='-shared'
  5298. +    else
  5299. +      shared_flag='${wl}-bM:SRE'
  5300. +      hardcode_direct=yes
  5301. +    fi
  5302. +    allow_undefined_flag=' ${wl}-berok'
  5303. +    archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
  5304. +    archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
  5305. +    case "$host_os" in aix4.[01]|aix4.[01].*)
  5306. +      # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
  5307. +      always_export_symbols=yes ;;
  5308. +    esac
  5309. +   ;;
  5310.  
  5311.    amigaos*)
  5312. -    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib$libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  5313. +    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  5314.      hardcode_libdir_flag_spec='-L$libdir'
  5315.      hardcode_minus_L=yes
  5316. +    # see comment about different semantics on the GNU ld section
  5317. +    ld_shlibs=no
  5318.      ;;
  5319.  
  5320. -  cygwin32* | mingw32*)
  5321. -    if test "$with_gcc" = yes; then
  5322. -      # hardcode_libdir_flag_spec is actually meaningless, as there is
  5323. -      # no search path for DLLs.
  5324. -      hardcode_libdir_flag_spec='-L$libdir'
  5325. -      allow_undefined_flag=unsupported
  5326. -      # Very, very bogus.
  5327. -      echo '
  5328. -#define WIN32_LEAN_AND_MEAN
  5329. -#include <windows.h>
  5330. -#undef WIN32_LEAN_AND_MEAN
  5331. -#include <stdio.h>
  5332. -
  5333. -BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
  5334. -
  5335. -#include <cygwin/cygwin_dll.h>
  5336. -DECLARE_CYGWIN_DLL( DllMain );
  5337. -HINSTANCE __hDllInstance_base;
  5338. +  cygwin* | mingw*)
  5339. +    # When not using gcc, we currently assume that we are using
  5340. +    # Microsoft Visual C++.
  5341. +    # hardcode_libdir_flag_spec is actually meaningless, as there is
  5342. +    # no search path for DLLs.
  5343. +    hardcode_libdir_flag_spec=' '
  5344. +    allow_undefined_flag=unsupported
  5345. +    # Tell ltmain to make .lib files, not .a files.
  5346. +    libext=lib
  5347. +    # FIXME: Setting linknames here is a bad hack.
  5348. +    archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  5349. +    # The linker will automatically build a .lib file if we build a DLL.
  5350. +    old_archive_from_new_cmds='true'
  5351. +    # FIXME: Should let the user specify the lib program.
  5352. +    old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  5353. +    fix_srcfile_path='`cygpath -w $srcfile`'
  5354. +    ;;
  5355.  
  5356. -BOOL APIENTRY
  5357. -DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
  5358. -{
  5359. -  __hDllInstance_base = hInst;
  5360. -  return TRUE;
  5361. -}
  5362. -' > ltdll.c
  5363. -      archive_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~
  5364. -      $DLLTOOL --export-all --output-def $lib-def $libobjs ltdll.$objext~
  5365. -      $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~
  5366. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  5367. -      $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  5368. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  5369. -      $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  5370. -      $rm ltdll.$objext $soname-base $soname-exp'
  5371. -      archive_sym_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~
  5372. -      cat "$export_symbols" >> $lib-def~
  5373. -      $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~
  5374. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  5375. -      $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  5376. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  5377. -      $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  5378. -      $rm ltdll.$objext $soname-base $soname-exp'
  5379. -      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $lib-def --output-lib $objdir/$libname.a~$rm $lib.exp'
  5380. -    else
  5381. -      # When not using gcc, we currently assume that we are using
  5382. -      # Microsoft Visual C++.
  5383. -      # hardcode_libdir_flag_spec is actually meaningless, as there is
  5384. -      # no search path for DLLs.
  5385. -      hardcode_libdir_flag_spec=' '
  5386. -      allow_undefined_flag=unsupported
  5387. -      # Tell ltmain to make .lib files, not .a files.
  5388. -      libext=lib
  5389. -      # FIXME: Setting linknames here is a bad hack.
  5390. -      archive_cmds='$CC -o $lib$libobjs`echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  5391. -      # The linker will automatically build a .lib file if we build a DLL.
  5392. -      old_archive_from_new_cmds='true'
  5393. -      # FIXME: Should let the user specify the lib program.
  5394. -      old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  5395. -      fix_srcfile_path='`cygpath -w $srcfile`'
  5396. -    fi
  5397. +  freebsd1*)
  5398. +    ld_shlibs=no
  5399.      ;;
  5400.  
  5401.    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  5402. @@ -1185,65 +1260,64 @@
  5403.    # does not break anything, and helps significantly (at the cost of a little
  5404.    # extra space).
  5405.    freebsd2.2*)
  5406. -    archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs /usr/lib/c++rt0.o'
  5407. +    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
  5408.      hardcode_libdir_flag_spec='-R$libdir'
  5409.      hardcode_direct=yes
  5410. -    hardcode_minus_L=yes
  5411.      hardcode_shlibpath_var=no
  5412.      ;;
  5413.  
  5414.    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  5415.    freebsd2*)
  5416. -    archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
  5417. +    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  5418.      hardcode_direct=yes
  5419.      hardcode_minus_L=yes
  5420.      hardcode_shlibpath_var=no
  5421.      ;;
  5422.  
  5423. -  # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
  5424. -  freebsd3*)
  5425. -    archive_cmds='$CC -shared -o $lib$libobjs$deplibs'
  5426. +  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  5427. +  freebsd*)
  5428. +    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts'
  5429.      hardcode_libdir_flag_spec='-R$libdir'
  5430.      hardcode_direct=yes
  5431. -    hardcode_minus_L=no
  5432.      hardcode_shlibpath_var=no
  5433.      ;;
  5434.  
  5435. -  hpux9*)
  5436. -    archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs$deplibs~test $objdir/$soname = $lib || mv $objdir/$soname $lib'
  5437. -    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  5438. -    hardcode_direct=yes
  5439. -    hardcode_minus_L=yes
  5440. -    export_dynamic_flag_spec='${wl}-E'
  5441. -    ;;
  5442. -
  5443. -  hpux10* | hpux11*)
  5444. -    archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs$deplibs'
  5445. +  hpux9* | hpux10* | hpux11*)
  5446. +    case "$host_os" in
  5447. +    hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;;
  5448. +    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;;
  5449. +    esac
  5450.      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  5451. +    hardcode_libdir_separator=:
  5452.      hardcode_direct=yes
  5453. -    hardcode_minus_L=yes
  5454. +    hardcode_minus_L=yes # Not in the search PATH, but as the default
  5455. +             # location of the library.
  5456.      export_dynamic_flag_spec='${wl}-E'
  5457.      ;;
  5458.  
  5459.    irix5* | irix6*)
  5460.      if test "$with_gcc" = yes; then
  5461. -      archive_cmds='$CC -shared -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring$libobjs$deplibs'
  5462. +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
  5463.      else
  5464. -      archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
  5465. +      archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
  5466.      fi
  5467.      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  5468. +    hardcode_libdir_separator=:
  5469.      ;;
  5470.  
  5471.    netbsd*)
  5472. -    # Tested with NetBSD 1.2 ld
  5473. -    archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
  5474. -    hardcode_libdir_flag_spec='-R$libdir'
  5475. +    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  5476. +      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'  # a.out
  5477. +    else
  5478. +      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts'      # ELF
  5479. +    fi
  5480. +    hardcode_libdir_flag_spec='${wl}-R$libdir'
  5481.      hardcode_direct=yes
  5482.      hardcode_shlibpath_var=no
  5483.      ;;
  5484.  
  5485.    openbsd*)
  5486. -    archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
  5487. +    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  5488.      hardcode_libdir_flag_spec='-R$libdir'
  5489.      hardcode_direct=yes
  5490.      hardcode_shlibpath_var=no
  5491. @@ -1253,7 +1327,7 @@
  5492.      hardcode_libdir_flag_spec='-L$libdir'
  5493.      hardcode_minus_L=yes
  5494.      allow_undefined_flag=unsupported
  5495. -    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp$libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib$libobjs$deplibs $objdir/$libname.def'
  5496. +    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def'
  5497.      old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
  5498.      ;;
  5499.  
  5500. @@ -1260,10 +1334,10 @@
  5501.    osf3* | osf4*)
  5502.      if test "$with_gcc" = yes; then
  5503.        allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  5504. -      archive_cmds='$CC -shared${allow_undefined_flag} -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring$libobjs$deplibs'
  5505. +      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
  5506.      else
  5507.        allow_undefined_flag=' -expect_unresolved \*'
  5508. -      archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
  5509. +      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
  5510.      fi
  5511.      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  5512.      hardcode_libdir_separator=:
  5513. @@ -1270,8 +1344,10 @@
  5514.      ;;
  5515.  
  5516.    sco3.2v5*)
  5517. -    archive_cmds='$LD -G -o $lib$libobjs$deplibs'
  5518. -    hardcode_direct=yes
  5519. +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  5520. +    hardcode_shlibpath_var=no
  5521. +    runpath_var=LD_RUN_PATH
  5522. +    hardcode_runpath_var=yes
  5523.      ;;
  5524.  
  5525.    solaris*)
  5526. @@ -1278,27 +1354,20 @@
  5527.      no_undefined_flag=' -z text'
  5528.      # $CC -shared without GNU ld will not create a library from C++
  5529.      # object files and a static libstdc++, better avoid it by now
  5530. -    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs$deplibs'
  5531. -    archive_sym_cmds='$echo "{ global:" > $lib.exp~sed $export_symbols -e "s/.*/\1;/" >> $lib.exp~$echo "local: * }" >> $lib.exp~
  5532. -        $LD -G${allow_undefined_flag} -M $export_symbols -h $soname -o $lib$libobjs$deplibs~$rm $lib.exp'
  5533. +    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
  5534. +    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  5535. +        $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
  5536.      hardcode_libdir_flag_spec='-R$libdir'
  5537.      hardcode_shlibpath_var=no
  5538. -
  5539. -    # Solaris 2 before 2.5 hardcodes -L paths.
  5540.      case "$host_os" in
  5541. -    solaris2.[0-4]*)
  5542. -      hardcode_minus_L=yes
  5543. -      ;;
  5544. +    solaris2.[0-5] | solaris2.[0-5].*) ;;
  5545. +    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
  5546. +      whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;;
  5547.      esac
  5548.      ;;
  5549.  
  5550.    sunos4*)
  5551. -    # Why do we need -Bstatic?  To avoid inter-library dependencies, maybe...
  5552. -    if test "$with_gcc" = yes; then
  5553. -      archive_cmds='$CC -shared ${wl}-Bstatic -o $lib$libobjs$deplibs'
  5554. -    else
  5555. -      archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs$deplibs'
  5556. -    fi
  5557. +    archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
  5558.      hardcode_libdir_flag_spec='-L$libdir'
  5559.      hardcode_direct=yes
  5560.      hardcode_minus_L=yes
  5561. @@ -1305,50 +1374,61 @@
  5562.      hardcode_shlibpath_var=no
  5563.      ;;
  5564.  
  5565. +  sysv4)
  5566. +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  5567. +    runpath_var='LD_RUN_PATH'
  5568. +    hardcode_shlibpath_var=no
  5569. +    hardcode_direct=no #Motorola manual says yes, but my tests say they lie 
  5570. +    ;;  
  5571. +
  5572. +  sysv4.3*)
  5573. +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  5574. +    hardcode_shlibpath_var=no
  5575. +    export_dynamic_flag_spec='-Bexport'
  5576. +    ;;
  5577. +
  5578.    uts4*)
  5579. -    archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs'
  5580. +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  5581.      hardcode_libdir_flag_spec='-L$libdir'
  5582. -    hardcode_direct=no
  5583. -    hardcode_minus_L=no
  5584.      hardcode_shlibpath_var=no
  5585.      ;;
  5586.  
  5587.    dgux*)
  5588. -    archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs'
  5589. +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  5590.      hardcode_libdir_flag_spec='-L$libdir'
  5591. -    hardcode_direct=no
  5592. -    hardcode_minus_L=no
  5593.      hardcode_shlibpath_var=no
  5594.      ;;
  5595.  
  5596.    *)
  5597.      ld_shlibs=no
  5598. -    can_build_shared=no
  5599.      ;;
  5600.    esac
  5601.  fi
  5602.  echo "$ac_t$ld_shlibs" 1>&6
  5603. +test "$ld_shlibs" = no && can_build_shared=no
  5604.  
  5605.  if test -z "$NM"; then
  5606.    echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
  5607.    case "$NM" in
  5608. -  /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path.
  5609. +  [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path.
  5610.    *)
  5611. -    IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  5612. -    for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
  5613. +    IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  5614. +    for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
  5615.        test -z "$ac_dir" && ac_dir=.
  5616. -      if test -f $ac_dir/nm; then
  5617. -        # Check to see if the nm accepts a BSD-compat flag.
  5618. -        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  5619. -        #   nm: unknown option "B" ignored
  5620. -        if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  5621. -          NM="$ac_dir/nm -B"
  5622. -        elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  5623. -          NM="$ac_dir/nm -p"
  5624. +      if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then
  5625. +    # Check to see if the nm accepts a BSD-compat flag.
  5626. +    # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  5627. +    #   nm: unknown option "B" ignored
  5628. +    if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  5629. +      NM="$ac_dir/nm -B"
  5630. +      break
  5631. +    elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  5632. +      NM="$ac_dir/nm -p"
  5633. +      break
  5634.      else
  5635. -          NM="$ac_dir/nm"
  5636. +      NM=${NM="$ac_dir/nm"} # keep the first match, but
  5637. +      continue # so that we can try to find one that supports BSD flags
  5638.      fi
  5639. -        break
  5640.        fi
  5641.      done
  5642.      IFS="$ac_save_ifs"
  5643. @@ -1365,52 +1445,54 @@
  5644.  # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
  5645.  
  5646.  # Character class describing NM global symbol codes.
  5647. -symcode='[BCDEGRSTU]'
  5648. +symcode='[BCDEGRST]'
  5649.  
  5650.  # Regexp to match symbols that can be accessed directly from C.
  5651.  sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
  5652.  
  5653.  # Transform the above into a raw symbol and a C symbol.
  5654. -symxfrm='\1 \1'
  5655. +symxfrm='\1 \2\3 \3'
  5656. +
  5657. +# Transform an extracted symbol line into a proper C declaration
  5658. +global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
  5659.  
  5660.  # Define system-specific variables.
  5661.  case "$host_os" in
  5662.  aix*)
  5663. -  symcode='[BCDTU]'
  5664. +  symcode='[BCDT]'
  5665.    ;;
  5666. -sunos* | cygwin32* | mingw32*)
  5667. -  sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
  5668. -  symxfrm='_\1 \1'
  5669. +cygwin* | mingw*)
  5670. +  symcode='[ABCDGISTW]'
  5671. +  ;;
  5672. +hpux*) # Its linker distinguishes data from code symbols
  5673. +  global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
  5674.    ;;
  5675.  irix*)
  5676. -  # Cannot use undefined symbols on IRIX because inlined functions mess us up.
  5677.    symcode='[BCDEGRST]'
  5678.    ;;
  5679.  solaris*)
  5680. -  symcode='[BDTU]'
  5681. +  symcode='[BDT]'
  5682. +  ;;
  5683. +sysv4)
  5684. +  symcode='[DFNSTU]'
  5685.    ;;
  5686.  esac
  5687.  
  5688.  # If we're using GNU nm, then use its standard symbol codes.
  5689.  if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  5690. -  symcode='[ABCDGISTUW]'
  5691. +  symcode='[ABCDGISTW]'
  5692.  fi
  5693.  
  5694. -case "$host_os" in
  5695. -cygwin32* | mingw32*)
  5696. -  # We do not want undefined symbols on cygwin32.  The user must
  5697. -  # arrange to define them via -l arguments.
  5698. -  symcode='[ABCDGISTW]'
  5699. -  ;;
  5700. -esac
  5701. +# Try without a prefix undercore, then with it.
  5702. +for ac_symprfx in "" "_"; do
  5703.  
  5704. -# Write the raw and C identifiers.
  5705. -global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
  5706. +  # Write the raw and C identifiers.
  5707. +  global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode\)[     ][     ]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
  5708.  
  5709. -# Check to see that the pipe works correctly.
  5710. -pipe_works=no
  5711. -$rm conftest*
  5712. -cat > conftest.c <<EOF
  5713. +  # Check to see that the pipe works correctly.
  5714. +  pipe_works=no
  5715. +  $rm conftest*
  5716. +  cat > conftest.c <<EOF
  5717.  #ifdef __cplusplus
  5718.  extern "C" {
  5719.  #endif
  5720. @@ -1422,56 +1504,50 @@
  5721.  main(){nm_test_var='a';nm_test_func();return(0);}
  5722.  EOF
  5723.  
  5724. -echo "$progname:1425: checking if global_symbol_pipe works" >&5
  5725. -if { (eval echo $progname:1426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
  5726. -  # Now try to grab the symbols.
  5727. -  nlist=conftest.nm
  5728. -  if { echo "$progname:1429: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  5729. -
  5730. -    # Try sorting and uniquifying the output.
  5731. -    if sort "$nlist" | uniq > "$nlist"T; then
  5732. -      mv -f "$nlist"T "$nlist"
  5733. -      wcout=`wc "$nlist" 2>/dev/null`
  5734. -      count=`$echo "X$wcout" | $Xsed -e 's/^[     ]*\([0-9][0-9]*\).*$/\1/'`
  5735. -      (test "$count" -ge 0) 2>/dev/null || count=-1
  5736. -    else
  5737. -      rm -f "$nlist"T
  5738. -      count=-1
  5739. -    fi
  5740. +  echo "$progname:1507: checking if global_symbol_pipe works" >&5
  5741. +  if { (eval echo $progname:1508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
  5742. +    # Now try to grab the symbols.
  5743. +    nlist=conftest.nm
  5744. +    if { echo "$progname:1511: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  5745. +
  5746. +      # Try sorting and uniquifying the output.
  5747. +      if sort "$nlist" | uniq > "$nlist"T; then
  5748. +    mv -f "$nlist"T "$nlist"
  5749. +      else
  5750. +    rm -f "$nlist"T
  5751. +      fi
  5752.  
  5753. -    # Make sure that we snagged all the symbols we need.
  5754. -    if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  5755. -      if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  5756. -    cat <<EOF > conftest.c
  5757. +      # Make sure that we snagged all the symbols we need.
  5758. +      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  5759. +    if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  5760. +      cat <<EOF > conftest.c
  5761.  #ifdef __cplusplus
  5762.  extern "C" {
  5763.  #endif
  5764.  
  5765.  EOF
  5766. -        # Now generate the symbol file.
  5767. -        sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
  5768. +      # Now generate the symbol file.
  5769. +      eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
  5770.  
  5771. -    cat <<EOF >> conftest.c
  5772. +      cat <<EOF >> conftest.c
  5773.  #if defined (__STDC__) && __STDC__
  5774. -# define __ptr_t void *
  5775. +# define lt_ptr_t void *
  5776.  #else
  5777. -# define __ptr_t char *
  5778. +# define lt_ptr_t char *
  5779. +# define const
  5780.  #endif
  5781.  
  5782. -/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
  5783. -int dld_preloaded_symbol_count = $count;
  5784. -
  5785.  /* The mapping between symbol names and symbols. */
  5786. -struct {
  5787. -  char *name;
  5788. -  __ptr_t address;
  5789. +const struct {
  5790. +  const char *name;
  5791. +  lt_ptr_t address;
  5792.  }
  5793. -dld_preloaded_symbols[] =
  5794. +lt_preloaded_symbols[] =
  5795.  {
  5796.  EOF
  5797. -        sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c
  5798. -        cat <<\EOF >> conftest.c
  5799. -  {0, (__ptr_t) 0}
  5800. +      sed 's/^. \(.*\) \(.*\)$/  {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
  5801. +      cat <<\EOF >> conftest.c
  5802. +  {0, (lt_ptr_t) 0}
  5803.  };
  5804.  
  5805.  #ifdef __cplusplus
  5806. @@ -1478,37 +1554,50 @@
  5807.  }
  5808.  #endif
  5809.  EOF
  5810. -        # Now try linking the two files.
  5811. -        mv conftest.$objext conftestm.$objext
  5812. -    save_LIBS="$LIBS"
  5813. -    save_CFLAGS="$CFLAGS"
  5814. -        LIBS="conftestm.$objext"
  5815. -    CFLAGS="$CFLAGS$no_builtin_flag"
  5816. -        if { (eval echo $progname:1487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  5817. -          pipe_works=yes
  5818. -        else
  5819. -          echo "$progname: failed program was:" >&5
  5820. -          cat conftest.c >&5
  5821. -        fi
  5822. -        LIBS="$save_LIBS"
  5823. +      # Now try linking the two files.
  5824. +      mv conftest.$objext conftstm.$objext
  5825. +      save_LIBS="$LIBS"
  5826. +      save_CFLAGS="$CFLAGS"
  5827. +      LIBS="conftstm.$objext"
  5828. +      CFLAGS="$CFLAGS$no_builtin_flag"
  5829. +      if { (eval echo $progname:1563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  5830. +        pipe_works=yes
  5831. +      else
  5832. +        echo "$progname: failed program was:" >&5
  5833. +        cat conftest.c >&5
  5834. +      fi
  5835. +      LIBS="$save_LIBS"
  5836. +    else
  5837. +      echo "cannot find nm_test_func in $nlist" >&5
  5838. +    fi
  5839.        else
  5840. -        echo "cannot find nm_test_func in $nlist" >&5
  5841. +    echo "cannot find nm_test_var in $nlist" >&5
  5842.        fi
  5843.      else
  5844. -      echo "cannot find nm_test_var in $nlist" >&5
  5845. +      echo "cannot run $global_symbol_pipe" >&5
  5846.      fi
  5847.    else
  5848. -    echo "cannot run $global_symbol_pipe" >&5
  5849. +    echo "$progname: failed program was:" >&5
  5850. +    cat conftest.c >&5
  5851.    fi
  5852. +  $rm conftest* conftst*
  5853. +
  5854. +  # Do not use the global_symbol_pipe unless it works.
  5855. +  if test "$pipe_works" = yes; then
  5856. +    break
  5857. +  else
  5858. +    global_symbol_pipe=
  5859. +  fi
  5860. +done
  5861. +if test "$pipe_works" = yes; then
  5862. +  echo "${ac_t}ok" 1>&6
  5863.  else
  5864. -  echo "$progname: failed program was:" >&5
  5865. -  cat conftest.c >&5
  5866. +  echo "${ac_t}failed" 1>&6
  5867.  fi
  5868. -$rm conftest*
  5869.  
  5870. -# Do not use the global_symbol_pipe unless it works.
  5871. -echo "$ac_t$pipe_works" 1>&6
  5872. -test "$pipe_works" = yes || global_symbol_pipe=
  5873. +if test -z "$global_symbol_pipe"; then
  5874. +  global_symbol_to_cdecl=
  5875. +fi
  5876.  
  5877.  # Check hardcoding attributes.
  5878.  echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
  5879. @@ -1517,10 +1606,12 @@
  5880.     test -n "$runpath_var"; then
  5881.  
  5882.    # We can hardcode non-existant directories.
  5883. -  if test "$hardcode_direct" != no && \
  5884. -     test "$hardcode_minus_L" != no && \
  5885. -     test "$hardcode_shlibpath_var" != no; then
  5886. -
  5887. +  if test "$hardcode_direct" != no &&
  5888. +     # If the only mechanism to avoid hardcoding is shlibpath_var, we
  5889. +     # have to relink, otherwise we might link with an installed library
  5890. +     # when we should be linking with a yet-to-be-installed one
  5891. +     ## test "$hardcode_shlibpath_var" != no &&
  5892. +     test "$hardcode_minus_L" != no; then
  5893.      # Linking always hardcodes the temporary library directory.
  5894.      hardcode_action=relink
  5895.    else
  5896. @@ -1552,26 +1643,27 @@
  5897.  finish_cmds=
  5898.  finish_eval=
  5899.  shlibpath_var=
  5900. +shlibpath_overrides_runpath=unknown
  5901.  version_type=none
  5902.  dynamic_linker="$host_os ld.so"
  5903. -sys_lib_search_path="/lib /usr/lib /usr/local/lib"
  5904. -check_shared_deplibs_method='none'
  5905. +sys_lib_dlsearch_path_spec="/lib /usr/lib"
  5906. +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  5907. +file_magic_cmd=
  5908. +file_magic_test_file=
  5909. +deplibs_check_method='unknown'
  5910.  # Need to set the preceding variable on all platforms that support
  5911.  # interlibrary dependencies.
  5912.  # 'none' -- dependencies not supported.
  5913. +# `unknown' -- same as none, but documents that we really don't know.
  5914.  # 'pass_all' -- all dependencies passed with no checks.
  5915.  # 'test_compile' -- check by making test program.
  5916. -# 'file_regex' -- check by looking for filenames that look like the shared
  5917. -# library in the library path.
  5918. -# 'file_magic [regex]' -- check by looking for files in library path which
  5919. -# responds to the "file" command with a given regex.  This is actually a
  5920. -# superset of the file_regex command.  If you have file on your system, you'll
  5921. -# want to use this instead.
  5922. -# Notes: regexes are run through expr.
  5923. -
  5924. +# 'file_magic [regex]' -- check by looking for files in library path
  5925. +# which responds to the $file_magic_cmd with a given egrep regex.
  5926. +# If you have `file' or equivalent on your system and you're not sure
  5927. +# whether `pass_all' will *always* work, you probably want this one.
  5928.  echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
  5929.  case "$host_os" in
  5930. -aix3* | aix4*)
  5931. +aix3*)
  5932.    version_type=linux
  5933.    library_names_spec='${libname}${release}.so$versuffix $libname.a'
  5934.    shlibpath_var=LIBPATH
  5935. @@ -1580,6 +1672,18 @@
  5936.    soname_spec='${libname}${release}.so$major'
  5937.    ;;
  5938.  
  5939. +aix4*)
  5940. +  version_type=linux
  5941. +  # AIX has no versioning support, so currently we can not hardcode correct
  5942. +  # soname into executable. Probably we can add versioning support to
  5943. +  # collect2, so additional links can be useful in future.
  5944. +  # We preserve .a as extension for shared libraries though AIX4.2
  5945. +  # and later linker supports .so
  5946. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a'
  5947. +  shlibpath_var=LIBPATH
  5948. +  deplibs_check_method=pass_all
  5949. +  ;;
  5950. +
  5951.  amigaos*)
  5952.    library_names_spec='$libname.ixlibrary $libname.a'
  5953.    # Create ${libname}_ixlibrary.a entries in /sys/libs.
  5954. @@ -1586,15 +1690,32 @@
  5955.    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
  5956.    ;;
  5957.  
  5958. +beos*)
  5959. +  library_names_spec='${libname}.so'
  5960. +  dynamic_linker="$host_os ld.so"
  5961. +  shlibpath_var=LIBRARY_PATH
  5962. +  lt_cv_dlopen="load_add_on"
  5963. +  lt_cv_dlopen_libs=
  5964. +  lt_cv_dlopen_self=yes
  5965. +  ;;
  5966. +
  5967.  bsdi4*)
  5968.    version_type=linux
  5969. -  library_names_spec='${libname}.so.$major ${libname}.so'
  5970. +  library_names_spec='${libname}.so$major ${libname}.so'
  5971.    soname_spec='${libname}.so'
  5972. -  finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir'
  5973. +  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
  5974.    shlibpath_var=LD_LIBRARY_PATH
  5975. +  deplibs_check_method='file_magic ELF 32-bit LSB shared object'
  5976. +  file_magic_cmd=/usr/bin/file
  5977. +  file_magic_test_file=/shlib/libc.so
  5978. +  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  5979. +  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  5980. +  # the default ld.so.conf also contains /usr/contrib/lib and
  5981. +  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  5982. +  # libtool to hard-code these into programs
  5983.    ;;
  5984.  
  5985. -cygwin32* | mingw32*)
  5986. +cygwin* | mingw*)
  5987.    version_type=windows
  5988.    if test "$with_gcc" = yes; then
  5989.      library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
  5990. @@ -1602,15 +1723,38 @@
  5991.      library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
  5992.    fi
  5993.    dynamic_linker='Win32 ld.exe'
  5994. -  libname_spec='$name'
  5995. +  deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
  5996. +  file_magic_cmd='${OBJDUMP} -f'
  5997. +  need_lib_prefix=no
  5998. +  # FIXME: first we should search . and the directory the executable is in
  5999.    shlibpath_var=PATH
  6000. +  lt_cv_dlopen="LoadLibrary"
  6001. +  lt_cv_dlopen_libs=
  6002.    ;;
  6003.  
  6004. -freebsd2* | freebsd3*)
  6005. +freebsd1*)
  6006. +  dynamic_linker=no
  6007. +  ;;
  6008. +  
  6009. +freebsd*)
  6010.    objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
  6011.    version_type=freebsd-$objformat
  6012. -  library_names_spec='${libname}${release}.so$versuffix $libname.so'
  6013. -  finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="$objformat" ldconfig -m $libdir'
  6014. +  case "$version_type" in
  6015. +    freebsd-elf*)
  6016. +      deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
  6017. +      file_magic_cmd=/usr/bin/file
  6018. +      file_magic_test_file=`echo /usr/lib/libc.so*`
  6019. +      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  6020. +      need_version=no
  6021. +      need_lib_prefix=no
  6022. +      ;;
  6023. +    freebsd-*)
  6024. +      deplibs_check_method=unknown
  6025. +      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
  6026. +      need_version=yes
  6027. +      ;;
  6028. +  esac
  6029. +  finish_cmds='PATH="\$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir'
  6030.    shlibpath_var=LD_LIBRARY_PATH
  6031.    ;;
  6032.  
  6033. @@ -1625,7 +1769,10 @@
  6034.    # link against other versions.
  6035.    dynamic_linker="$host_os dld.sl"
  6036.    version_type=sunos
  6037. +  need_lib_prefix=no
  6038. +  need_version=no
  6039.    shlibpath_var=SHLIB_PATH
  6040. +  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
  6041.    library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
  6042.    soname_spec='${libname}${release}.sl$major'
  6043.    # HP-UX runs *really* slowly unless shared libraries are mode 555.
  6044. @@ -1632,18 +1779,36 @@
  6045.    postinstall_cmds='chmod 555 $lib'
  6046.    ;;
  6047.  
  6048. -irix5*)
  6049. -  version_type=osf
  6050. -  soname_spec='${libname}${release}.so'
  6051. -  library_names_spec='${libname}${release}.so$versuffix $libname.so'
  6052. -  shlibpath_var=LD_LIBRARY_PATH
  6053. -  ;;
  6054. -
  6055. -irix6*)
  6056. -  version_type=osf
  6057. -  soname_spec='${libname}${release}.so'
  6058. -  library_names_spec='${libname}${release}.so$versuffix $libname.so'
  6059. -  shlibpath_var=LD_LIBRARYN32_PATH
  6060. +irix5* | irix6*)
  6061. +  version_type=irix
  6062. +  need_lib_prefix=no
  6063. +  need_version=no
  6064. +  soname_spec='${libname}${release}.so.$major'
  6065. +  library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so'
  6066. +  case "$host_os" in
  6067. +  irix5*)
  6068. +    libsuff= shlibsuff=
  6069. +    # this will be overridden with pass_all, but let us keep it just in case
  6070. +    deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
  6071. +    ;;
  6072. +  *)
  6073. +    case "$LD" in # libtool.m4 will add one of these switches to LD
  6074. +    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
  6075. +    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
  6076. +    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
  6077. +    *) libsuff= shlibsuff= libmagic=never-match;;
  6078. +    esac
  6079. +    # this will be overridden with pass_all, but let us keep it just in case
  6080. +    deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
  6081. +    ;;
  6082. +  esac
  6083. +  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
  6084. +  shlibpath_overrides_runpath=no
  6085. +  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
  6086. +  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
  6087. +  file_magic_cmd=/usr/bin/file
  6088. +  file_magic_test_file=`echo /lib${libsuff}/libc.so*`
  6089. +  deplibs_check_method='pass_all'
  6090.    ;;
  6091.  
  6092.  # No shared lib support for Linux oldld, aout, or coff.
  6093. @@ -1654,12 +1819,16 @@
  6094.  # This must be Linux ELF.
  6095.  linux-gnu*)
  6096.    version_type=linux
  6097. +  need_lib_prefix=no
  6098. +  need_version=no
  6099.    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  6100.    soname_spec='${libname}${release}.so$major'
  6101.    finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
  6102.    shlibpath_var=LD_LIBRARY_PATH
  6103. -  check_shared_deplibs_method='file_magic ELF 32-bit LSB shared object'
  6104. -  sys_lib_search_path="/lib /usr/lib /usr/local/lib `echo $LD_LIBRARY_PATH | sed -e 's/:/ /g'`"
  6105. +  shlibpath_overrides_runpath=no
  6106. +  deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
  6107. +  file_magic_cmd=/usr/bin/file
  6108. +  file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
  6109.  
  6110.    if test -f /lib/ld.so.1; then
  6111.      dynamic_linker='GNU ld.so'
  6112. @@ -1672,9 +1841,27 @@
  6113.    fi
  6114.    ;;
  6115.  
  6116. -netbsd* | openbsd*)
  6117. +netbsd*)
  6118. +  version_type=sunos
  6119. +  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  6120. +    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  6121. +    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  6122. +    dynamic_linker='NetBSD (a.out) ld.so'
  6123. +  else
  6124. +    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
  6125. +    soname_spec='${libname}${release}.so$major'
  6126. +    dynamic_linker='NetBSD ld.elf_so'
  6127. +  fi
  6128. +  shlibpath_var=LD_LIBRARY_PATH
  6129. +  ;;
  6130. +
  6131. +openbsd*)
  6132.    version_type=sunos
  6133. -  library_names_spec='${libname}${release}.so$versuffix'
  6134. +  if test "$with_gnu_ld" = yes; then
  6135. +    need_lib_prefix=no
  6136. +    need_version=no
  6137. +  fi
  6138. +  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  6139.    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  6140.    shlibpath_var=LD_LIBRARY_PATH
  6141.    ;;
  6142. @@ -1681,6 +1868,7 @@
  6143.  
  6144.  os2*)
  6145.    libname_spec='$name'
  6146. +  need_lib_prefix=no
  6147.    library_names_spec='$libname.dll $libname.a'
  6148.    dynamic_linker='OS/2 ld.exe'
  6149.    shlibpath_var=LIBPATH
  6150. @@ -1688,10 +1876,17 @@
  6151.  
  6152.  osf3* | osf4*)
  6153.    version_type=osf
  6154. +  need_version=no
  6155.    soname_spec='${libname}${release}.so'
  6156. -  library_names_spec='${libname}${release}.so$versuffix $libname.so'
  6157. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  6158.    shlibpath_var=LD_LIBRARY_PATH
  6159. -  check_shared_deplibs_method='pass_all'
  6160. +  # this will be overridden with pass_all, but let us keep it just in case
  6161. +  deplibs_check_method='file_magic COFF format alpha shared library'
  6162. +  file_magic_cmd=/usr/bin/file
  6163. +  file_magic_test_file=/shlib/libc.so
  6164. +  deplibs_check_method='pass_all'
  6165. +  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
  6166. +  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
  6167.    ;;
  6168.  
  6169.  sco3.2v5*)
  6170. @@ -1703,11 +1898,17 @@
  6171.  
  6172.  solaris*)
  6173.    version_type=linux
  6174. +  need_lib_prefix=no
  6175. +  need_version=no
  6176.    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  6177.    soname_spec='${libname}${release}.so$major'
  6178.    shlibpath_var=LD_LIBRARY_PATH
  6179. +  shlibpath_overrides_runpath=yes
  6180.    # ldd complains unless libraries are executable
  6181.    postinstall_cmds='chmod +x $lib'
  6182. +  deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib"
  6183. +  file_magic_cmd=/usr/bin/file
  6184. +  file_magic_test_file=/lib/libc.so
  6185.    ;;
  6186.  
  6187.  sunos4*)
  6188. @@ -1715,24 +1916,45 @@
  6189.    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  6190.    finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
  6191.    shlibpath_var=LD_LIBRARY_PATH
  6192. +  shlibpath_overrides_runpath=yes
  6193. +  if test "$with_gnu_ld" = yes; then
  6194. +    need_lib_prefix=no
  6195. +  fi
  6196. +  need_version=yes
  6197.    ;;
  6198.  
  6199. -sysv4.2uw2*)
  6200. +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  6201.    version_type=linux
  6202.    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  6203.    soname_spec='${libname}${release}.so$major'
  6204.    shlibpath_var=LD_LIBRARY_PATH
  6205. +  case "$host_vendor" in
  6206. +    ncr)
  6207. +      deplibs_check_method='pass_all'
  6208. +      ;;
  6209. +    motorola)
  6210. +      need_lib_prefix=no
  6211. +      need_version=no
  6212. +      shlibpath_overrides_runpath=no
  6213. +      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
  6214. +      deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
  6215. +      file_magic_cmd=/usr/bin/file
  6216. +      file_magic_test_file=`echo /usr/lib/libc.so*`
  6217. +      ;;
  6218. +  esac
  6219.    ;;
  6220.  
  6221.  uts4*)
  6222.    version_type=linux
  6223. -  library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  6224. -  soname_spec='${libname}${release}.so.$major'
  6225. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  6226. +  soname_spec='${libname}${release}.so$major'
  6227.    shlibpath_var=LD_LIBRARY_PATH
  6228.    ;;
  6229.  
  6230.  dgux*)
  6231.    version_type=linux
  6232. +  need_lib_prefix=no
  6233. +  need_version=no
  6234.    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  6235.    soname_spec='${libname}${release}.so$major'
  6236.    shlibpath_var=LD_LIBRARY_PATH
  6237. @@ -1748,6 +1970,41 @@
  6238.  # Report the final consequences.
  6239.  echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
  6240.  
  6241. +# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
  6242. +# configure.in, otherwise build static only libraries.
  6243. +case "$host_os" in
  6244. +cygwin* | mingw* | os2*)
  6245. +  if test x$can_build_shared = xyes; then
  6246. +    test x$enable_win32_dll = xno && can_build_shared=no
  6247. +    echo "checking if package supports dlls... $can_build_shared" 1>&6
  6248. +  fi
  6249. +;;
  6250. +esac
  6251. +
  6252. +if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then
  6253. +  case "$deplibs_check_method" in
  6254. +  "file_magic "*)
  6255. +    file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
  6256. +    if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
  6257. +       egrep "$file_magic_regex" > /dev/null; then
  6258. +      :
  6259. +    else
  6260. +      cat <<EOF 1>&2
  6261. +
  6262. +*** Warning: the command libtool uses to detect shared libraries,
  6263. +*** $file_magic_cmd, produces output that libtool cannot recognize.
  6264. +*** The result is that libtool may fail to recognize shared libraries
  6265. +*** as such.  This will affect the creation of libtool libraries that
  6266. +*** depend on shared libraries, but programs linked with such libtool
  6267. +*** libraries will work regardless of this problem.  Nevertheless, you
  6268. +*** may want to report the problem to your system manager and/or to
  6269. +*** bug-libtool@gnu.org
  6270. +
  6271. +EOF
  6272. +    fi ;;
  6273. +  esac
  6274. +fi
  6275. +
  6276.  echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
  6277.  test "$can_build_shared" = "no" && enable_shared=no
  6278.  
  6279. @@ -1754,7 +2011,7 @@
  6280.  # On AIX, shared libraries and static libraries use the same namespace, and
  6281.  # are all built from PIC.
  6282.  case "$host_os" in
  6283. -aix*)
  6284. +aix3*)
  6285.    test "$enable_shared" = yes && enable_static=no
  6286.    if test -n "$RANLIB"; then
  6287.      archive_cmds="$archive_cmds~\$RANLIB \$lib"
  6288. @@ -1761,6 +2018,10 @@
  6289.      postinstall_cmds='$RANLIB $lib'
  6290.    fi
  6291.    ;;
  6292. +
  6293. +aix4*)
  6294. +  test "$enable_shared" = yes && enable_static=no
  6295. +  ;;
  6296.  esac
  6297.  
  6298.  echo "$ac_t$enable_shared" 1>&6
  6299. @@ -1770,6 +2031,15 @@
  6300.  
  6301.  echo "checking whether to build static libraries... $enable_static" 1>&6
  6302.  
  6303. +if test "$hardcode_action" = relink; then
  6304. +  # Fast installation is not supported
  6305. +  enable_fast_install=no
  6306. +elif test "$shlibpath_overrides_runpath" = yes ||
  6307. +     test "$enable_shared" = no; then
  6308. +  # Fast installation is not necessary
  6309. +  enable_fast_install=needless
  6310. +fi
  6311. +
  6312.  echo $ac_n "checking for objdir... $ac_c" 1>&6
  6313.  rm -f .libs 2>/dev/null
  6314.  mkdir .libs 2>/dev/null
  6315. @@ -1782,6 +2052,435 @@
  6316.  rmdir .libs 2>/dev/null
  6317.  echo "$ac_t$objdir" 1>&6
  6318.  
  6319. +if test "x$enable_dlopen" != xyes; then
  6320. +  enable_dlopen=unknown
  6321. +  enable_dlopen_self=unknown
  6322. +  enable_dlopen_self_static=unknown
  6323. +else
  6324. +if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
  6325. +  lt_cv_dlopen=no lt_cv_dlopen_libs=
  6326. +echo $ac_n "checking for dlopen""... $ac_c" 1>&6
  6327. +echo "$progname:2063: checking for dlopen" >&5
  6328. +if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
  6329. +  echo $ac_n "(cached) $ac_c" 1>&6
  6330. +else
  6331. +  cat > conftest.$ac_ext <<EOF
  6332. +#line 2068 "ltconfig"
  6333. +/* System header to define __stub macros and hopefully few prototypes,
  6334. +    which can conflict with char dlopen(); below.  */
  6335. +#include <assert.h>
  6336. +/* Override any gcc2 internal prototype to avoid an error.  */
  6337. +/* We use char because int might match the return type of a gcc2
  6338. +    builtin and then its argument prototype would still apply.  */
  6339. +char dlopen();
  6340. +
  6341. +int main() {
  6342. +
  6343. +/* The GNU C library defines this for functions which it implements
  6344. +    to always fail with ENOSYS.  Some functions are actually named
  6345. +    something starting with __ and the normal name is an alias.  */
  6346. +#if defined (__stub_dlopen) || defined (__stub___dlopen)
  6347. +choke me
  6348. +#else
  6349. +dlopen();
  6350. +#endif
  6351. +
  6352. +; return 0; }
  6353. +EOF
  6354. +if { (eval echo $progname:2090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6355. +  rm -rf conftest*
  6356. +  eval "ac_cv_func_dlopen=yes"
  6357. +else
  6358. +  echo "$progname: failed program was:" >&5
  6359. +  cat conftest.$ac_ext >&5
  6360. +  rm -rf conftest*
  6361. +  eval "ac_cv_func_dlopen=no"
  6362. +fi
  6363. +rm -f conftest*
  6364. +fi
  6365. +
  6366. +if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
  6367. +  echo "$ac_t""yes" 1>&6
  6368. +  lt_cv_dlopen="dlopen"
  6369. +else
  6370. +  echo "$ac_t""no" 1>&6
  6371. +echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
  6372. +echo "$progname:2108: checking for dlopen in -ldl" >&5
  6373. +ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
  6374. +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  6375. +  echo $ac_n "(cached) $ac_c" 1>&6
  6376. +else
  6377. +  ac_save_LIBS="$LIBS"
  6378. +LIBS="-ldl  $LIBS"
  6379. +cat > conftest.$ac_ext <<EOF
  6380. +#line 2116 "ltconfig"
  6381. +/* Override any gcc2 internal prototype to avoid an error.  */
  6382. +/* We use char because int might match the return type of a gcc2
  6383. +    builtin and then its argument prototype would still apply.  */
  6384. +char dlopen();
  6385. +
  6386. +int main() {
  6387. +dlopen()
  6388. +; return 0; }
  6389. +EOF
  6390. +if { (eval echo $progname:2126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6391. +  rm -rf conftest*
  6392. +  eval "ac_cv_lib_$ac_lib_var=yes"
  6393. +else
  6394. +  echo "$progname: failed program was:" >&5
  6395. +  cat conftest.$ac_ext >&5
  6396. +  rm -rf conftest*
  6397. +  eval "ac_cv_lib_$ac_lib_var=no"
  6398. +fi
  6399. +rm -f conftest*
  6400. +LIBS="$ac_save_LIBS"
  6401. +
  6402. +fi
  6403. +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  6404. +  echo "$ac_t""yes" 1>&6
  6405. +  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
  6406. +else
  6407. +  echo "$ac_t""no" 1>&6
  6408. +echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
  6409. +echo "$progname:2145: checking for dld_link in -ldld" >&5
  6410. +ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
  6411. +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  6412. +  echo $ac_n "(cached) $ac_c" 1>&6
  6413. +else
  6414. +  ac_save_LIBS="$LIBS"
  6415. +LIBS="-ldld  $LIBS"
  6416. +cat > conftest.$ac_ext <<EOF
  6417. +#line 2153 "ltconfig"
  6418. +/* Override any gcc2 internal prototype to avoid an error.  */
  6419. +/* We use char because int might match the return type of a gcc2
  6420. +    builtin and then its argument prototype would still apply.  */
  6421. +char dld_link();
  6422. +
  6423. +int main() {
  6424. +dld_link()
  6425. +; return 0; }
  6426. +EOF
  6427. +if { (eval echo $progname:2163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6428. +  rm -rf conftest*
  6429. +  eval "ac_cv_lib_$ac_lib_var=yes"
  6430. +else
  6431. +  echo "$progname: failed program was:" >&5
  6432. +  cat conftest.$ac_ext >&5
  6433. +  rm -rf conftest*
  6434. +  eval "ac_cv_lib_$ac_lib_var=no"
  6435. +fi
  6436. +rm -f conftest*
  6437. +LIBS="$ac_save_LIBS"
  6438. +
  6439. +fi
  6440. +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  6441. +  echo "$ac_t""yes" 1>&6
  6442. +  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
  6443. +else
  6444. +  echo "$ac_t""no" 1>&6
  6445. +echo $ac_n "checking for shl_load""... $ac_c" 1>&6
  6446. +echo "$progname:2182: checking for shl_load" >&5
  6447. +if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
  6448. +  echo $ac_n "(cached) $ac_c" 1>&6
  6449. +else
  6450. +  cat > conftest.$ac_ext <<EOF
  6451. +#line 2187 "ltconfig"
  6452. +/* System header to define __stub macros and hopefully few prototypes,
  6453. +    which can conflict with char shl_load(); below.  */
  6454. +#include <assert.h>
  6455. +/* Override any gcc2 internal prototype to avoid an error.  */
  6456. +/* We use char because int might match the return type of a gcc2
  6457. +    builtin and then its argument prototype would still apply.  */
  6458. +char shl_load();
  6459. +
  6460. +int main() {
  6461. +
  6462. +/* The GNU C library defines this for functions which it implements
  6463. +    to always fail with ENOSYS.  Some functions are actually named
  6464. +    something starting with __ and the normal name is an alias.  */
  6465. +#if defined (__stub_shl_load) || defined (__stub___shl_load)
  6466. +choke me
  6467. +#else
  6468. +shl_load();
  6469. +#endif
  6470. +
  6471. +; return 0; }
  6472. +EOF
  6473. +if { (eval echo $progname:2209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6474. +  rm -rf conftest*
  6475. +  eval "ac_cv_func_shl_load=yes"
  6476. +else
  6477. +  echo "$progname: failed program was:" >&5
  6478. +  cat conftest.$ac_ext >&5
  6479. +  rm -rf conftest*
  6480. +  eval "ac_cv_func_shl_load=no"
  6481. +fi
  6482. +rm -f conftest*
  6483. +fi
  6484. +
  6485. +if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
  6486. +  echo "$ac_t""yes" 1>&6
  6487. +  lt_cv_dlopen="shl_load"
  6488. +else
  6489. +  echo "$ac_t""no" 1>&6
  6490. +echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
  6491. +echo "$progname:2227: checking for shl_load in -ldld" >&5
  6492. +ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
  6493. +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  6494. +  echo $ac_n "(cached) $ac_c" 1>&6
  6495. +else
  6496. +  ac_save_LIBS="$LIBS"
  6497. +LIBS="-ldld  $LIBS"
  6498. +cat > conftest.$ac_ext <<EOF
  6499. +#line 2235 "ltconfig"
  6500. +#include "confdefs.h"
  6501. +/* Override any gcc2 internal prototype to avoid an error.  */
  6502. +/* We use char because int might match the return type of a gcc2
  6503. +    builtin and then its argument prototype would still apply.  */
  6504. +char shl_load();
  6505. +
  6506. +int main() {
  6507. +shl_load()
  6508. +; return 0; }
  6509. +EOF
  6510. +if { (eval echo $progname:2246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6511. +  rm -rf conftest*
  6512. +  eval "ac_cv_lib_$ac_lib_var=yes"
  6513. +else
  6514. +  echo "$progname: failed program was:" >&5
  6515. +  cat conftest.$ac_ext >&5
  6516. +  rm -rf conftest*
  6517. +  eval "ac_cv_lib_$ac_lib_var=no"
  6518. +fi
  6519. +rm -f conftest*
  6520. +LIBS="$ac_save_LIBS"
  6521. +
  6522. +fi
  6523. +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  6524. +  echo "$ac_t""yes" 1>&6
  6525. +  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
  6526. +else
  6527. +  echo "$ac_t""no" 1>&6
  6528. +fi
  6529. +
  6530. +
  6531. +fi
  6532. +
  6533. +    
  6534. +fi
  6535. +
  6536. +  
  6537. +fi
  6538. +
  6539. +
  6540. +fi
  6541. +
  6542. +fi
  6543. +
  6544. +  if test "x$lt_cv_dlopen" != xno; then
  6545. +    enable_dlopen=yes
  6546. +  fi
  6547. +
  6548. +  case "$lt_cv_dlopen" in
  6549. +  dlopen)
  6550. +for ac_hdr in dlfcn.h; do
  6551. +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  6552. +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  6553. +echo "$progname:2289: checking for $ac_hdr" >&5
  6554. +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  6555. +  echo $ac_n "(cached) $ac_c" 1>&6
  6556. +else
  6557. +  cat > conftest.$ac_ext <<EOF
  6558. +#line 2294 "ltconfig"
  6559. +#include <$ac_hdr>
  6560. +int fnord = 0;
  6561. +EOF
  6562. +ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out"
  6563. +{ (eval echo $progname:2299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  6564. +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  6565. +if test -z "$ac_err"; then
  6566. +  rm -rf conftest*
  6567. +  eval "ac_cv_header_$ac_safe=yes"
  6568. +else
  6569. +  echo "$ac_err" >&5
  6570. +  echo "$progname: failed program was:" >&5
  6571. +  cat conftest.$ac_ext >&5
  6572. +  rm -rf conftest*
  6573. +  eval "ac_cv_header_$ac_safe=no"
  6574. +fi
  6575. +rm -f conftest*
  6576. +fi
  6577. +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  6578. +  echo "$ac_t""yes" 1>&6
  6579. +else
  6580. +  echo "$ac_t""no" 1>&6
  6581. +fi
  6582. +done
  6583. +
  6584. +    if test "x$ac_cv_header_dlfcn_h" = xyes; then
  6585. +      CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
  6586. +    fi
  6587. +    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
  6588. +    LIBS="$lt_cv_dlopen_libs $LIBS"
  6589. +
  6590. +  echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
  6591. +echo "$progname:2327: checking whether a program can dlopen itself" >&5
  6592. +if test "${lt_cv_dlopen_self+set}" = set; then
  6593. +  echo $ac_n "(cached) $ac_c" 1>&6
  6594. +else
  6595. +  if test "$cross_compiling" = yes; then
  6596. +    lt_cv_dlopen_self=cross
  6597. +  else
  6598. +    cat > conftest.c <<EOF
  6599. +#line 2335 "ltconfig"
  6600. +
  6601. +#if HAVE_DLFCN_H
  6602. +#include <dlfcn.h>
  6603. +#endif
  6604. +
  6605. +#include <stdio.h>
  6606. +
  6607. +#ifdef RTLD_GLOBAL
  6608. +# define LTDL_GLOBAL    RTLD_GLOBAL
  6609. +#else
  6610. +# ifdef DL_GLOBAL
  6611. +#  define LTDL_GLOBAL    DL_GLOBAL
  6612. +# else
  6613. +#  define LTDL_GLOBAL    0
  6614. +# endif
  6615. +#endif
  6616. +
  6617. +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
  6618. +   find out it does not work in some platform. */
  6619. +#ifndef LTDL_LAZY_OR_NOW
  6620. +# ifdef RTLD_LAZY
  6621. +#  define LTDL_LAZY_OR_NOW    RTLD_LAZY
  6622. +# else
  6623. +#  ifdef DL_LAZY
  6624. +#   define LTDL_LAZY_OR_NOW    DL_LAZY
  6625. +#  else
  6626. +#   ifdef RTLD_NOW
  6627. +#    define LTDL_LAZY_OR_NOW    RTLD_NOW
  6628. +#   else
  6629. +#    ifdef DL_NOW
  6630. +#     define LTDL_LAZY_OR_NOW    DL_NOW
  6631. +#    else
  6632. +#     define LTDL_LAZY_OR_NOW    0
  6633. +#    endif
  6634. +#   endif
  6635. +#  endif
  6636. +# endif
  6637. +#endif
  6638. +
  6639. +fnord() { int i=42;}
  6640. +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
  6641. +    if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
  6642. +           if(ptr1 || ptr2) exit(0); } exit(1); } 
  6643. +
  6644. +EOF
  6645. +if { (eval echo $progname:2381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
  6646. +then
  6647. +  lt_cv_dlopen_self=yes
  6648. +else
  6649. +  echo "$progname: failed program was:" >&5
  6650. +  cat conftest.$ac_ext >&5
  6651. +  rm -fr conftest*
  6652. +  lt_cv_dlopen_self=no
  6653. +fi
  6654. +rm -fr conftest*
  6655. +fi
  6656. +
  6657. +fi
  6658. +
  6659. +echo "$ac_t""$lt_cv_dlopen_self" 1>&6
  6660. +
  6661. +  if test "$lt_cv_dlopen_self" = yes; then
  6662. +    LDFLAGS="$LDFLAGS $link_static_flag"
  6663. +  echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
  6664. +echo "$progname:2400: checking whether a statically linked program can dlopen itself" >&5
  6665. +if test "${lt_cv_dlopen_self_static+set}" = set; then
  6666. +  echo $ac_n "(cached) $ac_c" 1>&6
  6667. +else
  6668. +  if test "$cross_compiling" = yes; then
  6669. +    lt_cv_dlopen_self_static=cross
  6670. +  else
  6671. +    cat > conftest.c <<EOF
  6672. +#line 2408 "ltconfig"
  6673. +
  6674. +#if HAVE_DLFCN_H
  6675. +#include <dlfcn.h>
  6676. +#endif
  6677. +
  6678. +#include <stdio.h>
  6679. +
  6680. +#ifdef RTLD_GLOBAL
  6681. +# define LTDL_GLOBAL    RTLD_GLOBAL
  6682. +#else
  6683. +# ifdef DL_GLOBAL
  6684. +#  define LTDL_GLOBAL    DL_GLOBAL
  6685. +# else
  6686. +#  define LTDL_GLOBAL    0
  6687. +# endif
  6688. +#endif
  6689. +
  6690. +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
  6691. +   find out it does not work in some platform. */
  6692. +#ifndef LTDL_LAZY_OR_NOW
  6693. +# ifdef RTLD_LAZY
  6694. +#  define LTDL_LAZY_OR_NOW    RTLD_LAZY
  6695. +# else
  6696. +#  ifdef DL_LAZY
  6697. +#   define LTDL_LAZY_OR_NOW    DL_LAZY
  6698. +#  else
  6699. +#   ifdef RTLD_NOW
  6700. +#    define LTDL_LAZY_OR_NOW    RTLD_NOW
  6701. +#   else
  6702. +#    ifdef DL_NOW
  6703. +#     define LTDL_LAZY_OR_NOW    DL_NOW
  6704. +#    else
  6705. +#     define LTDL_LAZY_OR_NOW    0
  6706. +#    endif
  6707. +#   endif
  6708. +#  endif
  6709. +# endif
  6710. +#endif
  6711. +
  6712. +fnord() { int i=42;}
  6713. +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
  6714. +    if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
  6715. +    if(ptr1 || ptr2) exit(0); } exit(1); } 
  6716. +
  6717. +EOF
  6718. +if { (eval echo $progname:2454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
  6719. +then
  6720. +  lt_cv_dlopen_self_static=yes
  6721. +else
  6722. +  echo "$progname: failed program was:" >&5
  6723. +  cat conftest.$ac_ext >&5
  6724. +  rm -fr conftest*
  6725. +  lt_cv_dlopen_self_static=no
  6726. +fi
  6727. +rm -fr conftest*
  6728. +fi
  6729. +
  6730. +fi
  6731. +
  6732. +echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
  6733. +fi
  6734. +    ;;
  6735. +  esac
  6736. +
  6737. +  case "$lt_cv_dlopen_self" in
  6738. +  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  6739. +  *) enable_dlopen_self=unknown ;;
  6740. +  esac
  6741. +
  6742. +  case "$lt_cv_dlopen_self_static" in
  6743. +  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  6744. +  *) enable_dlopen_self_static=unknown ;;
  6745. +  esac
  6746. +fi
  6747. +
  6748.  # Copy echo and quote the copy, instead of the original, because it is
  6749.  # used later.
  6750.  ltecho="$echo"
  6751. @@ -1790,30 +2489,36 @@
  6752.  fi
  6753.  LTSHELL="$SHELL"
  6754.  
  6755. +LTCONFIG_VERSION="$VERSION"
  6756. +
  6757.  # Only quote variables if we're using ltmain.sh.
  6758.  case "$ltmain" in
  6759.  *.sh)
  6760.    # Now quote all the things that may contain metacharacters.
  6761. -  for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
  6762. -    old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL VERSION \
  6763. +  for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \
  6764. +    old_LD old_LDFLAGS old_LIBS \
  6765. +    old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \
  6766. +    AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
  6767.      reload_flag reload_cmds wl \
  6768.      pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
  6769. -    whole_archive_flag_spec libname_spec library_names_spec soname_spec \
  6770. +    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
  6771. +    library_names_spec soname_spec \
  6772.      RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
  6773. -    old_postuninstall_cmds archive_cmds archive_sym_cmds postinstall_cmds postuninstall_cmds \
  6774. -    check_shared_deplibs_method allow_undefined_flag no_undefined_flag \
  6775. -    finish_cmds finish_eval global_symbol_pipe \
  6776. -    hardcode_libdir_flag_spec hardcode_libdir_separator sys_lib_search_path \
  6777. -    compiler_c_o compiler_o_lo need_locks; do
  6778. +    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \
  6779. +    file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \
  6780. +    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
  6781. +    hardcode_libdir_flag_spec hardcode_libdir_separator  \
  6782. +    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
  6783. +    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
  6784.  
  6785.      case "$var" in
  6786.      reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
  6787.      old_postinstall_cmds | old_postuninstall_cmds | \
  6788. -    archive_cmds | archive_sym_cmds | \
  6789. +    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
  6790.      postinstall_cmds | postuninstall_cmds | \
  6791. -    finish_cmds | sys_lib_search_path)
  6792. +    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
  6793.        # Double-quote double-evaled strings.
  6794. -      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`\\\""
  6795. +      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
  6796.        ;;
  6797.      *)
  6798.        eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
  6799. @@ -1823,8 +2528,7 @@
  6800.  
  6801.    case "$ltecho" in
  6802.    *'\$0 --fallback-echo"')
  6803. -    ltecho=`$echo "X$ltecho" |
  6804. -        $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
  6805. +    ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
  6806.      ;;
  6807.    esac
  6808.  
  6809. @@ -1835,10 +2539,10 @@
  6810.  #! $SHELL
  6811.  
  6812.  # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
  6813. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION)
  6814. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
  6815.  # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
  6816.  #
  6817. -# Copyright (C) 1996-1998 Free Software Foundation, Inc.
  6818. +# Copyright (C) 1996-1999 Free Software Foundation, Inc.
  6819.  # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  6820.  #
  6821.  # This program is free software; you can redistribute it and/or modify
  6822. @@ -1874,8 +2578,9 @@
  6823.  
  6824.  *)
  6825.    # Double-quote the variables that need it (for aesthetics).
  6826. -  for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
  6827. -    old_LN_S old_DLLTOOL old_AS; do
  6828. +  for var in old_CC old_CFLAGS old_CPPFLAGS \
  6829. +    old_LD old_LDFLAGS old_LIBS \
  6830. +    old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do
  6831.      eval "$var=\\\"\$var\\\""
  6832.    done
  6833.  
  6834. @@ -1886,7 +2591,7 @@
  6835.    $rm "$cfgfile"
  6836.    cat <<EOF > "$cfgfile"
  6837.  # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
  6838. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION)
  6839. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
  6840.  EOF
  6841.    ;;
  6842.  esac
  6843. @@ -1895,8 +2600,9 @@
  6844.  # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  6845.  #
  6846.  # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
  6847. -# LD=$old_LD NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
  6848. -# DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\
  6849. +# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\
  6850. +# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
  6851. +# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\
  6852.  #   $0$ltconfig_args
  6853.  #
  6854.  # Compiler and other test output produced by $progname, useful for
  6855. @@ -1903,7 +2609,7 @@
  6856.  # debugging $progname, is in ./config.log if it exists.
  6857.  
  6858.  # The version of $progname that generated this script.
  6859. -LTCONFIG_VERSION=$VERSION
  6860. +LTCONFIG_VERSION=$LTCONFIG_VERSION
  6861.  
  6862.  # Shell to use when invoking shell scripts.
  6863.  SHELL=$LTSHELL
  6864. @@ -1914,6 +2620,9 @@
  6865.  # Whether or not to build static libraries.
  6866.  build_old_libs=$enable_static
  6867.  
  6868. +# Whether or not to optimize for fast installation.
  6869. +fast_install=$enable_fast_install
  6870. +
  6871.  # The host system.
  6872.  host_alias=$host_alias
  6873.  host=$host
  6874. @@ -1936,10 +2645,13 @@
  6875.  # A BSD-compatible nm program.
  6876.  NM=$NM
  6877.  
  6878. -# Used on cygwin32: DLL creation program.
  6879. +# Used on cygwin: DLL creation program.
  6880.  DLLTOOL="$DLLTOOL"
  6881.  
  6882. -# Used on cygwin32: assembler.
  6883. +# Used on cygwin: object dumper.
  6884. +OBJDUMP="$OBJDUMP"
  6885. +
  6886. +# Used on cygwin: assembler.
  6887.  AS="$AS"
  6888.  
  6889.  # The name of the directory that contains temporary libtool files.
  6890. @@ -1961,7 +2673,7 @@
  6891.  # Additional compiler flags for building library objects.
  6892.  pic_flag=$pic_flag
  6893.  
  6894. -# Does compiler simultaneously support -c and -o options
  6895. +# Does compiler simultaneously support -c and -o options?
  6896.  compiler_c_o=$compiler_c_o
  6897.  
  6898.  # Can we write directly to a .lo ?
  6899. @@ -1970,6 +2682,21 @@
  6900.  # Must we lock files when doing compilation ?
  6901.  need_locks=$need_locks
  6902.  
  6903. +# Do we need the lib prefix for modules?
  6904. +need_lib_prefix=$need_lib_prefix
  6905. +
  6906. +# Do we need a version for libraries?
  6907. +need_version=$need_version
  6908. +
  6909. +# Whether dlopen is supported.
  6910. +dlopen=$enable_dlopen
  6911. +
  6912. +# Whether dlopen of programs is supported.
  6913. +dlopen_self=$enable_dlopen_self
  6914. +
  6915. +# Whether dlopen of statically linked programs is supported.
  6916. +dlopen_self_static=$enable_dlopen_self_static
  6917. +
  6918.  # Compiler flag to prevent dynamic linking.
  6919.  link_static_flag=$link_static_flag
  6920.  
  6921. @@ -1982,6 +2709,9 @@
  6922.  # Compiler flag to generate shared objects directly from archives.
  6923.  whole_archive_flag_spec=$whole_archive_flag_spec
  6924.  
  6925. +# Compiler flag to generate thread-safe objects.
  6926. +thread_safe_flag_spec=$thread_safe_flag_spec
  6927. +
  6928.  # Library versioning type.
  6929.  version_type=$version_type
  6930.  
  6931. @@ -2006,12 +2736,15 @@
  6932.  
  6933.  # Commands used to build and install a shared archive.
  6934.  archive_cmds=$archive_cmds
  6935. -archive_sym_cmds=$archive_sym_cmds
  6936. +archive_expsym_cmds=$archive_expsym_cmds
  6937.  postinstall_cmds=$postinstall_cmds
  6938.  postuninstall_cmds=$postuninstall_cmds
  6939.  
  6940.  # Method to check whether dependent libraries are shared objects.
  6941. -check_shared_deplibs_method=$check_shared_deplibs_method
  6942. +deplibs_check_method=$deplibs_check_method
  6943. +
  6944. +# Command to use when deplibs_check_method == file_magic.
  6945. +file_magic_cmd=$file_magic_cmd
  6946.  
  6947.  # Flag that allows shared libraries with undefined symbols to be built.
  6948.  allow_undefined_flag=$allow_undefined_flag
  6949. @@ -2028,6 +2761,9 @@
  6950.  # Take the output of nm and produce a listing of raw symbols and C names.
  6951.  global_symbol_pipe=$global_symbol_pipe
  6952.  
  6953. +# Transform the output of nm in a proper C declaration
  6954. +global_symbol_to_cdecl=$global_symbol_to_cdecl
  6955. +
  6956.  # This is the shared library runtime path variable.
  6957.  runpath_var=$runpath_var
  6958.  
  6959. @@ -2034,6 +2770,9 @@
  6960.  # This is the shared library path variable.
  6961.  shlibpath_var=$shlibpath_var
  6962.  
  6963. +# Is shlibpath searched before the hard-coded library search path?
  6964. +shlibpath_overrides_runpath=$shlibpath_overrides_runpath
  6965. +
  6966.  # How to hardcode a shared library path into an executable.
  6967.  hardcode_action=$hardcode_action
  6968.  
  6969. @@ -2056,11 +2795,27 @@
  6970.  # the resulting binary.
  6971.  hardcode_shlibpath_var=$hardcode_shlibpath_var
  6972.  
  6973. -# System search path for libraries
  6974. -sys_lib_search_path=$sys_lib_search_path
  6975. +# Compile-time system search path for libraries
  6976. +sys_lib_search_path_spec=$sys_lib_search_path_spec
  6977. +
  6978. +# Run-time system search path for libraries
  6979. +sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
  6980.  
  6981.  # Fix the shell variable \$srcfile for the compiler.
  6982.  fix_srcfile_path="$fix_srcfile_path"
  6983. +
  6984. +# Set to yes if exported symbols are required.
  6985. +always_export_symbols=$always_export_symbols
  6986. +
  6987. +# The commands to list exported symbols.
  6988. +export_symbols_cmds=$export_symbols_cmds
  6989. +
  6990. +# Symbols that should not be listed in the preloaded symbols.
  6991. +exclude_expsyms=$exclude_expsyms
  6992. +
  6993. +# Symbols that must always be exported.
  6994. +include_expsyms=$include_expsyms
  6995. +
  6996.  EOF
  6997.  
  6998.  case "$ltmain" in
  6999. @@ -2093,6 +2848,58 @@
  7000.    echo "FIXME: would compile $ltmain"
  7001.    ;;
  7002.  esac
  7003. +
  7004. +test -n "$cache_file" || exit 0
  7005. +
  7006. +# AC_CACHE_SAVE
  7007. +trap '' 1 2 15
  7008. +cat > confcache <<\EOF
  7009. +# This file is a shell script that caches the results of configure
  7010. +# tests run on this system so they can be shared between configure
  7011. +# scripts and configure runs.  It is not useful on other systems.
  7012. +# If it contains results you don't want to keep, you may remove or edit it.
  7013. +#
  7014. +# By default, configure uses ./config.cache as the cache file,
  7015. +# creating it if it does not exist already.  You can give configure
  7016. +# the --cache-file=FILE option to use a different cache file; that is
  7017. +# what configure does when it calls configure scripts in
  7018. +# subdirectories, so they share the cache.
  7019. +# Giving --cache-file=/dev/null disables caching, for debugging configure.
  7020. +# config.status only pays attention to the cache file if you give it the
  7021. +# --recheck option to rerun configure.
  7022. +#
  7023. +EOF
  7024. +# The following way of writing the cache mishandles newlines in values,
  7025. +# but we know of no workaround that is simple, portable, and efficient.
  7026. +# So, don't put newlines in cache variables' values.
  7027. +# Ultrix sh set writes to stderr and can't be redirected directly,
  7028. +# and sets the high bit in the cache file unless we assign to the vars.
  7029. +(set) 2>&1 |
  7030. +  case `(ac_space=' '; set | grep ac_space) 2>&1` in
  7031. +  *ac_space=\ *)
  7032. +    # `set' does not quote correctly, so add quotes (double-quote substitution
  7033. +    # turns \\\\ into \\, and sed turns \\ into \).
  7034. +    sed -n \
  7035. +      -e "s/'/'\\\\''/g" \
  7036. +      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
  7037. +    ;;
  7038. +  *)
  7039. +    # `set' quotes correctly as required by POSIX, so do not add quotes.
  7040. +    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
  7041. +    ;;
  7042. +  esac >> confcache
  7043. +if cmp -s $cache_file confcache; then
  7044. +  :
  7045. +else
  7046. +  if test -w $cache_file; then
  7047. +    echo "updating cache $cache_file"
  7048. +    cat confcache > $cache_file
  7049. +  else
  7050. +    echo "not updating unwritable cache $cache_file"
  7051. +  fi
  7052. +fi
  7053. +rm -f confcache
  7054. +
  7055.  exit 0
  7056.  
  7057.  # Local Variables:
  7058.